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

22
node_modules/@expo/metro/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,55 @@
import type * as _babel_types from "@babel/types";
import type { BabelFileMetadata } from "@babel/core";
export interface CustomTransformOptions {
[$$Key$$: string]: any;
}
export declare const enum _TransformProfile {
_default = "default",
hermesStable = "hermes-stable",
hermesCanary = "hermes-canary",
}
export type TransformProfile = `${_TransformProfile}`;
export interface BabelTransformerOptions {
readonly customTransformOptions?: CustomTransformOptions;
readonly dev: boolean;
readonly enableBabelRCLookup?: boolean;
readonly enableBabelRuntime?: boolean | string;
readonly extendsBabelConfigPath?: string;
readonly experimentalImportSupport?: boolean;
readonly hermesParser?: boolean;
readonly minify: boolean;
readonly platform?: null | string;
readonly projectRoot: string;
readonly publicPath: string;
readonly unstable_transformProfile?: TransformProfile;
readonly globalPrefix: string;
readonly inlineRequires?: void;
}
export interface BabelTransformerArgs {
readonly filename: string;
readonly options: BabelTransformerOptions;
readonly plugins?: any;
readonly src: string;
}
export interface BabelFileFunctionMapMetadata {
readonly names: ReadonlyArray<string>;
readonly mappings: string;
}
export type BabelFileImportLocsMetadata = ReadonlySet<string>;
export interface _MetroBabelFileMetadata_metro {
functionMap?: null | undefined | BabelFileFunctionMapMetadata;
unstable_importDeclarationLocs?: null | undefined | BabelFileImportLocsMetadata;
}
export interface MetroBabelFileMetadata extends BabelFileMetadata {
metro?: null | undefined | _MetroBabelFileMetadata_metro;
}
export interface BabelTransformer {
readonly transform: ($$PARAM_0$$: BabelTransformerArgs) => {
readonly ast: _babel_types.File;
readonly functionMap?: BabelFileFunctionMapMetadata;
readonly metadata?: MetroBabelFileMetadata;
};
readonly getCacheKey?: () => string;
}
declare function transform($$PARAM_0$$: BabelTransformerArgs): ReturnType<any>;
export { transform };

View File

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

12
node_modules/@expo/metro/metro-cache-key/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
/**
* 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
*/
export declare function getCacheKey(files: Array<string>): string;

2
node_modules/@expo/metro/metro-cache-key/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
module.exports = require("metro-cache-key");
module.exports.default = module.exports;

26
node_modules/@expo/metro/metro-cache/Cache.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
/**
* 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 { CacheStore } from "./types";
/**
* Main cache class. Receives an array of cache instances, and sequentially
* traverses them to return a previously stored value. It also ensures setting
* the value in all instances.
*
* All get/set operations are logged via Metro's logger.
*/
declare class Cache<T> {
constructor(stores: ReadonlyArray<CacheStore<T>>);
get(key: Buffer): Promise<null | undefined | T>;
set(key: Buffer, value: T): Promise<void>;
get isDisabled(): boolean;
}
export default Cache;

1
node_modules/@expo/metro/metro-cache/Cache.js generated vendored Normal file
View File

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

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

@@ -0,0 +1,20 @@
import Cache from "./Cache";
import stableHash from "./stableHash";
import AutoCleanFileStore from "./stores/AutoCleanFileStore";
import FileStore from "./stores/FileStore";
import HttpGetStore from "./stores/HttpGetStore";
import HttpStore from "./stores/HttpStore";
export type { Options as FileOptions } from "./stores/FileStore";
export type { Options as HttpOptions } from "./stores/HttpStore";
export type { CacheStore } from "./types";
export { AutoCleanFileStore, Cache, FileStore, HttpGetStore, HttpStore, stableHash };
export interface MetroCache {
readonly AutoCleanFileStore: typeof AutoCleanFileStore;
readonly Cache: typeof Cache;
readonly FileStore: typeof FileStore;
readonly HttpGetStore: typeof HttpGetStore;
readonly HttpStore: typeof HttpStore;
readonly stableHash: typeof stableHash;
}
declare const $$EXPORT_DEFAULT_DECLARATION$$: MetroCache;
export default $$EXPORT_DEFAULT_DECLARATION$$;

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

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

13
node_modules/@expo/metro/metro-cache/stableHash.d.ts generated vendored Normal file
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 stableHash(value: any): Buffer;
export default stableHash;

1
node_modules/@expo/metro/metro-cache/stableHash.js generated vendored Normal file
View File

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

View File

@@ -0,0 +1,29 @@
/**
* 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 { Options } from "./FileStore";
import FileStore from "./FileStore";
export interface CleanOptions extends Options {
readonly intervalMs?: number;
readonly cleanupThresholdMs?: number;
}
/**
* A FileStore that, at a given interval, stats the content of the cache root
* and deletes any file last modified a set threshold in the past.
*
* @deprecated This is not efficiently implemented and may cause significant
* redundant I/O when caches are large. Prefer your own cleanup scripts, or a
* custom Metro cache that uses watches, hooks get/set, and/or implements LRU.
*/
declare class AutoCleanFileStore<T> extends FileStore<T> {
constructor(opts: CleanOptions);
}
export default AutoCleanFileStore;

View File

@@ -0,0 +1 @@
module.exports = require("metro-cache/private/stores/AutoCleanFileStore");

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
*/
export interface Options {
readonly root: string;
}
declare class FileStore<T> {
constructor(options: Options);
get(key: Buffer): Promise<null | undefined | T>;
set(key: Buffer, value: T): Promise<void>;
clear(): void;
}
export default FileStore;

View File

@@ -0,0 +1 @@
module.exports = require("metro-cache/private/stores/FileStore");

View File

@@ -0,0 +1,15 @@
/**
* 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
*/
declare class HttpError extends Error {
code: number;
constructor(message: string, code: number);
}
export default HttpError;

View File

@@ -0,0 +1 @@
module.exports = require("metro-cache/private/stores/HttpError");

View File

@@ -0,0 +1,19 @@
/**
* 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 { Options as HttpOptions } from "./HttpStore";
import HttpStore from "./HttpStore";
declare class HttpGetStore<T> extends HttpStore<T> {
constructor(options: HttpOptions);
get(key: Buffer): Promise<null | undefined | T>;
set(_key: Buffer, _value: T): Promise<void>;
}
export default HttpGetStore;

View File

@@ -0,0 +1 @@
module.exports = require("metro-cache/private/stores/HttpGetStore");

View File

@@ -0,0 +1,41 @@
import HttpError from "./HttpError";
import NetworkError from "./NetworkError";
export type Options = EndpointOptions | {
getOptions: EndpointOptions;
setOptions: EndpointOptions;
};
export interface _EndpointOptions_headers {
[$$Key$$: string]: string;
}
export interface EndpointOptions {
endpoint: string;
family?: 4 | 6;
timeout?: number;
key?: string | ReadonlyArray<string> | Buffer | ReadonlyArray<Buffer>;
cert?: string | ReadonlyArray<string> | Buffer | ReadonlyArray<Buffer>;
ca?: string | ReadonlyArray<string> | Buffer | ReadonlyArray<Buffer>;
params?: URLSearchParams;
headers?: _EndpointOptions_headers;
additionalSuccessStatuses?: ReadonlyArray<number>;
/**
* Whether to include additional debug information in error messages.
*/
debug?: boolean;
/**
* Retry configuration
*/
maxAttempts?: number;
retryNetworkErrors?: boolean;
retryStatuses?: ReadonlySet<number>;
socketPath?: string;
proxy?: string;
}
declare class HttpStore<T> {
static HttpError: typeof HttpError;
static NetworkError: typeof NetworkError;
constructor(options: Options);
get(key: Buffer): Promise<null | undefined | T>;
set(key: Buffer, value: T): Promise<void>;
clear(): void;
}
export default HttpStore;

View File

@@ -0,0 +1 @@
module.exports = require("metro-cache/private/stores/HttpStore");

View File

@@ -0,0 +1,15 @@
/**
* 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
*/
declare class NetworkError extends Error {
code: string;
constructor(message: string, code: string);
}
export default NetworkError;

View File

@@ -0,0 +1 @@
module.exports = require("metro-cache/private/stores/NetworkError");

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

@@ -0,0 +1,17 @@
/**
* 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
*/
export interface CacheStore<T> {
name?: string;
get(key: Buffer): (null | undefined | T) | Promise<null | undefined | T>;
set(key: Buffer, value: T): void | Promise<void>;
clear(): void | Promise<void>;
}

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

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

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");

47
node_modules/@expo/metro/metro-core/Logger.d.ts generated vendored Normal file
View File

@@ -0,0 +1,47 @@
/**
* 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 { BundleOptions } from "../metro/shared/types";
export interface ActionLogEntryData {
action_name: string;
log_entry_label?: string;
}
export interface ActionStartLogEntry {
action_name?: string;
action_phase?: string;
log_entry_label: string;
log_session?: string;
start_timestamp?: [number, number];
}
export interface LogEntry {
action_name?: string;
action_phase?: string;
action_result?: string;
duration_ms?: number;
entry_point?: string;
file_name?: string;
log_entry_label: string;
log_session?: string;
start_timestamp?: [number, number];
outdated_modules?: number;
bundle_size?: number;
bundle_options?: BundleOptions;
bundle_hash?: string;
build_id?: string;
error_message?: string;
error_stack?: string;
}
declare function on(event: string, handler: (logEntry: LogEntry) => void): void;
declare function createEntry(data: LogEntry | string): LogEntry;
declare function createActionStartEntry(data: ActionLogEntryData | string): LogEntry;
declare function createActionEndEntry(logEntry: ActionStartLogEntry, error?: null | undefined | Error): LogEntry;
declare function log(logEntry: LogEntry): LogEntry;
export { on, createEntry, createActionStartEntry, createActionEndEntry, log };

2
node_modules/@expo/metro/metro-core/Logger.js generated vendored Normal file
View File

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

53
node_modules/@expo/metro/metro-core/Terminal.d.ts generated vendored Normal file
View File

@@ -0,0 +1,53 @@
/**
* 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 { Socket } from "node:net";
import type { Writable } from "node:stream";
type UnderlyingStream = Socket | Writable;
/**
* We don't just print things to the console, sometimes we also want to show
* and update progress. This utility just ensures the output stays neat: no
* missing newlines, no mangled log lines.
*
* const terminal = Terminal.default;
* terminal.status('Updating... 38%');
* terminal.log('warning: Something happened.');
* terminal.status('Updating, done.');
* terminal.persistStatus();
*
* The final output:
*
* warning: Something happened.
* Updating, done.
*
* Without the status feature, we may get a mangled output:
*
* Updating... 38%warning: Something happened.
* Updating, done.
*
* This is meant to be user-readable and TTY-oriented. We use stdout by default
* because it's more about status information than diagnostics/errors (stderr).
*
* Do not add any higher-level functionality in this class such as "warning" and
* "error" printers, as it is not meant for formatting/reporting. It has the
* single responsibility of handling status messages.
*/
declare class Terminal {
constructor(stream: UnderlyingStream, opts: {
ttyPrint?: boolean;
});
waitForUpdates(): Promise<void>;
flush(): Promise<void>;
status(format: string, ...args: Array<any>): string;
log(format: string, ...args: Array<any>): void;
persistStatus(): void;
}
export default Terminal;

1
node_modules/@expo/metro/metro-core/Terminal.js generated vendored Normal file
View File

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

13
node_modules/@expo/metro/metro-core/canonicalize.d.ts generated vendored Normal file
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 canonicalize(key: string, value: any): any;
export default canonicalize;

1
node_modules/@expo/metro/metro-core/canonicalize.js generated vendored Normal file
View File

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

14
node_modules/@expo/metro/metro-core/errors.d.ts generated vendored Normal file
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 AmbiguousModuleResolutionError from "./errors/AmbiguousModuleResolutionError";
import PackageResolutionError from "./errors/PackageResolutionError";
export { AmbiguousModuleResolutionError, PackageResolutionError };

2
node_modules/@expo/metro/metro-core/errors.js generated vendored Normal file
View File

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

View File

@@ -0,0 +1,18 @@
/**
* 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 { DuplicateHasteCandidatesError } from "../../metro-file-map";
declare class AmbiguousModuleResolutionError extends Error {
fromModulePath: string;
hasteError: DuplicateHasteCandidatesError;
constructor(fromModulePath: string, hasteError: DuplicateHasteCandidatesError);
}
export default AmbiguousModuleResolutionError;

View File

@@ -0,0 +1 @@
module.exports = require("metro-core/private/errors/AmbiguousModuleResolutionError");

View File

@@ -0,0 +1,23 @@
/**
* 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 { InvalidPackageError } from "../../metro-resolver";
declare class PackageResolutionError extends Error {
originModulePath: string;
packageError: InvalidPackageError;
targetModuleName: string;
constructor(opts: {
readonly originModulePath: string;
readonly packageError: InvalidPackageError;
readonly targetModuleName: string;
});
}
export default PackageResolutionError;

View File

@@ -0,0 +1 @@
module.exports = require("metro-core/private/errors/PackageResolutionError");

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

@@ -0,0 +1,22 @@
/**
* 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 AmbiguousModuleResolutionError from "./errors/AmbiguousModuleResolutionError";
import PackageResolutionError from "./errors/PackageResolutionError";
import * as Logger from "./Logger";
import Terminal from "./Terminal";
export { AmbiguousModuleResolutionError, Logger, PackageResolutionError, Terminal };
/**
* Backwards-compatibility with CommonJS consumers using interopRequireDefault.
* Do not add to this list.
*
* @deprecated Default import from 'metro-core' is deprecated, use named exports.
*/

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

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

65
node_modules/@expo/metro/metro-file-map/Watcher.d.ts generated vendored Normal file
View File

@@ -0,0 +1,65 @@
/**
* 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
*
*/
import type { Console, CrawlerOptions, FileData, Path, PerfLogger, WatcherBackend, WatcherBackendChangeEvent, WatchmanClocks } from "./flow-types";
import EventEmitter from "node:events";
export interface CrawlResult {
changedFiles: FileData;
clocks?: WatchmanClocks;
removedFiles: Set<Path>;
}
export interface WatcherOptions {
abortSignal: AbortSignal;
computeSha1: boolean;
console: Console;
enableSymlinks: boolean;
extensions: ReadonlyArray<string>;
forceNodeFilesystemAPI: boolean;
healthCheckFilePrefix: string;
ignoreForCrawl: ($$PARAM_0$$: string) => boolean;
ignorePatternForWatch: RegExp;
previousState: CrawlerOptions["previousState"];
perfLogger?: null | PerfLogger;
roots: ReadonlyArray<string>;
rootDir: string;
useWatchman: boolean;
watch: boolean;
watchmanDeferStates: ReadonlyArray<string>;
}
export type HealthCheckResult = {
type: "error";
timeout: number;
error: Error;
watcher?: null | string;
} | {
type: "success";
timeout: number;
timeElapsed: number;
watcher?: null | string;
} | {
type: "timeout";
timeout: number;
watcher?: null | string;
pauseReason?: null | string;
};
export declare class Watcher extends EventEmitter {
_options: WatcherOptions;
_backends: ReadonlyArray<WatcherBackend>;
_instanceId: number;
_nextHealthCheckId: number;
_pendingHealthChecks: Map<string, () => void>;
_activeWatcher: null | undefined | string;
constructor(options: WatcherOptions);
crawl(): Promise<CrawlResult>;
watch(onChange: (change: WatcherBackendChangeEvent) => void): Promise<void>;
_handleHealthCheckObservation(basename: string): void;
close(): Promise<void>;
checkHealth(timeout: number): Promise<HealthCheckResult>;
}

2
node_modules/@expo/metro/metro-file-map/Watcher.js generated vendored Normal file
View File

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

View File

@@ -0,0 +1,28 @@
/**
* 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 { BuildParameters, CacheData, CacheManager, CacheManagerFactoryOptions, CacheManagerWriteOptions } from "../flow-types";
export interface AutoSaveOptions {
readonly debounceMs: number;
}
export interface DiskCacheConfig {
readonly autoSave?: Partial<AutoSaveOptions> | boolean;
readonly cacheFilePrefix?: null | undefined | string;
readonly cacheDirectory?: null | undefined | string;
}
export declare class DiskCacheManager implements CacheManager {
constructor($$PARAM_0$$: CacheManagerFactoryOptions, $$PARAM_1$$: DiskCacheConfig);
static getCacheFilePath(buildParameters: BuildParameters, cacheFilePrefix?: null | undefined | string, cacheDirectory?: null | undefined | string): string;
getCacheFilePath(): string;
read(): Promise<null | undefined | CacheData>;
write(getSnapshot: () => CacheData, $$PARAM_1$$: CacheManagerWriteOptions): Promise<void>;
end(): Promise<void>;
}

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-file-map/private/cache/DiskCacheManager");
module.exports.default = module.exports;

13
node_modules/@expo/metro/metro-file-map/constants.d.ts generated vendored Normal file
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.
*
*
* @noformat - Flow comment syntax
*/
import type { HType } from "./flow-types";
declare const constants: HType;
export default constants;

1
node_modules/@expo/metro/metro-file-map/constants.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/constants");

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 hasNativeFindSupport(): Promise<boolean>;
export default hasNativeFindSupport;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/crawlers/node/hasNativeFindSupport");

View File

@@ -0,0 +1,17 @@
/**
* 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 { CanonicalPath, CrawlerOptions, FileData } from "../../flow-types";
declare function nodeCrawl(options: CrawlerOptions): Promise<{
removedFiles: Set<CanonicalPath>;
changedFiles: FileData;
}>;
export default nodeCrawl;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/crawlers/node/index");

View File

@@ -0,0 +1,18 @@
/**
* 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 { CanonicalPath, CrawlerOptions, FileData, WatchmanClocks } from "../../flow-types";
declare function watchmanCrawl($$PARAM_0$$: CrawlerOptions): Promise<{
changedFiles: FileData;
removedFiles: Set<CanonicalPath>;
clocks: WatchmanClocks;
}>;
export default watchmanCrawl;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/crawlers/watchman/index");

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
*
*/
import type { WatchmanQuery, WatchmanQuerySince } from "fb-watchman";
export declare function planQuery($$PARAM_0$$: {
readonly since?: null | WatchmanQuerySince;
readonly directoryFilters: ReadonlyArray<string>;
readonly extensions: ReadonlyArray<string>;
readonly includeSha1: boolean;
readonly includeSymlinks: boolean;
}): {
query: WatchmanQuery;
queryGenerator: string;
};

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-file-map/private/crawlers/watchman/planQuery");
module.exports.default = module.exports;

342
node_modules/@expo/metro/metro-file-map/flow-types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,342 @@
/**
* 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 { PerfLogger, PerfLoggerFactory, RootPerfLogger } from "../metro-config";
export type { PerfLoggerFactory, PerfLogger };
export interface BuildParameters {
readonly computeDependencies: boolean;
readonly computeSha1: boolean;
readonly enableHastePackages: boolean;
readonly enableSymlinks: boolean;
readonly extensions: ReadonlyArray<string>;
readonly forceNodeFilesystemAPI: boolean;
readonly ignorePattern: RegExp;
readonly plugins: ReadonlyArray<FileMapPlugin>;
readonly retainAllFiles: boolean;
readonly rootDir: string;
readonly roots: ReadonlyArray<string>;
readonly skipPackageJson: boolean;
readonly dependencyExtractor?: null | string;
readonly hasteImplModulePath?: null | string;
readonly cacheBreaker: string;
}
export interface BuildResult {
fileSystem: FileSystem;
hasteMap: HasteMap;
mockMap?: null | MockMap;
}
export interface CacheData {
readonly clocks: WatchmanClocks;
readonly fileSystemData: any;
readonly plugins: ReadonlyMap<string, V8Serializable>;
}
export interface CacheManager {
/**
* Called during startup to load initial state, if available. Provided to
* a crawler, which will return the delta between the initial state and the
* current file system state.
*/
read(): Promise<null | undefined | CacheData>;
/**
* Called when metro-file-map `build()` has applied changes returned by the
* crawler - i.e. internal state reflects the current file system state.
*
* getSnapshot may be retained and called at any time before end(), such as
* in response to eventSource 'change' events.
*/
write(getSnapshot: () => CacheData, opts: CacheManagerWriteOptions): Promise<void>;
/**
* The last call that will be made to this CacheManager. Any handles should
* be closed by the time this settles.
*/
end(): Promise<void>;
}
export interface CacheManagerEventSource {
onChange(listener: () => void): () => void;
}
export type CacheManagerFactory = (options: CacheManagerFactoryOptions) => CacheManager;
export interface CacheManagerFactoryOptions {
readonly buildParameters: BuildParameters;
}
export interface CacheManagerWriteOptions {
readonly changedSinceCacheRead: boolean;
readonly eventSource: CacheManagerEventSource;
readonly onWriteError: ($$PARAM_0$$: Error) => void;
}
export type CanonicalPath = string;
export interface ChangeEvent {
logger?: null | RootPerfLogger;
eventsQueue: EventsQueue;
}
export interface ChangeEventMetadata {
modifiedTime?: null | number;
size?: null | number;
type?: "f" | "d" | "l";
}
export type Console = typeof global.console;
export interface _CrawlerOptions_previousState {
readonly clocks: ReadonlyMap<CanonicalPath, WatchmanClockSpec>;
readonly fileSystem: FileSystem;
}
export interface CrawlerOptions {
abortSignal?: null | AbortSignal;
computeSha1: boolean;
console: Console;
extensions: ReadonlyArray<string>;
forceNodeFilesystemAPI: boolean;
ignore: IgnoreMatcher;
includeSymlinks: boolean;
perfLogger?: null | undefined | PerfLogger;
previousState: _CrawlerOptions_previousState;
rootDir: string;
roots: ReadonlyArray<string>;
onStatus: (status: WatcherStatus) => void;
}
export interface DependencyExtractor {
extract: (content: string, absoluteFilePath: string, defaultExtractor?: DependencyExtractor["extract"]) => Set<string>;
getCacheKey: () => string;
}
export type WatcherStatus = {
type: "watchman_slow_command";
timeElapsed: number;
command?: "watch-project" | "query";
} | {
type: "watchman_slow_command_complete";
timeElapsed: number;
command?: "watch-project" | "query";
} | {
type: "watchman_warning";
warning: any;
command?: "watch-project" | "query";
};
export type DuplicatesSet = Map<string, number>;
export type DuplicatesIndex = Map<string, Map<string, DuplicatesSet>>;
export type EventsQueue = Array<{
filePath: Path;
metadata: ChangeEventMetadata;
type: string;
}>;
export interface FileMapDelta {
readonly removed: Iterable<[CanonicalPath, FileMetadata]>;
readonly addedOrModified: Iterable<[CanonicalPath, FileMetadata]>;
}
export interface FileSystemState {
metadataIterator(opts: {
readonly includeNodeModules: boolean;
readonly includeSymlinks: boolean;
}): Iterable<{
baseName: string;
canonicalPath: string;
metadata: FileMetadata;
}>;
}
export interface FileMapPluginInitOptions<SerializableState> {
readonly files: FileSystemState;
readonly pluginState?: null | SerializableState;
}
type V8Serializable = {};
export interface FileMapPlugin<SerializableState = V8Serializable> {
readonly name: string;
initialize(initOptions: FileMapPluginInitOptions<SerializableState>): Promise<void>;
assertValid(): void;
bulkUpdate(delta: FileMapDelta): Promise<void>;
getSerializableSnapshot(): SerializableState;
onRemovedFile(relativeFilePath: string, fileMetadata: FileMetadata): void;
onNewOrModifiedFile(relativeFilePath: string, fileMetadata: FileMetadata): void;
getCacheKey(): string;
}
export interface HType {
MTIME: 0;
SIZE: 1;
VISITED: 2;
DEPENDENCIES: 3;
SHA1: 4;
SYMLINK: 5;
ID: 6;
PATH: 0;
TYPE: 1;
MODULE: 0;
PACKAGE: 1;
GENERIC_PLATFORM: "g";
NATIVE_PLATFORM: "native";
DEPENDENCY_DELIM: "\0";
}
export type HTypeValue = HType[keyof HType];
export type IgnoreMatcher = (item: string) => boolean;
export type FileData = Map<CanonicalPath, FileMetadata>;
export type FileMetadata = [null | undefined | number, number, 0 | 1, string, null | undefined | string, 0 | 1 | string, string];
export interface FileStats {
readonly fileType?: "f" | "l";
readonly modifiedTime?: null | number;
readonly size?: null | number;
}
export interface FileSystem {
exists(file: Path): boolean;
getAllFiles(): Array<Path>;
getDependencies(file: Path): null | undefined | Array<string>;
getDifference(files: FileData): {
changedFiles: FileData;
removedFiles: Set<string>;
};
getModuleName(file: Path): null | undefined | string;
getSerializableSnapshot(): CacheData["fileSystemData"];
getSha1(file: Path): null | undefined | string;
getOrComputeSha1(file: Path): Promise<null | undefined | {
sha1: string;
content?: Buffer;
}>;
/**
* Given a start path (which need not exist), a subpath and type, and
* optionally a 'breakOnSegment', performs the following:
*
* X = mixedStartPath
* do
* if basename(X) === opts.breakOnSegment
* return null
* if X + subpath exists and has type opts.subpathType
* return {
* absolutePath: realpath(X + subpath)
* containerRelativePath: relative(mixedStartPath, X)
* }
* X = dirname(X)
* while X !== dirname(X)
*
* If opts.invalidatedBy is given, collects all absolute, real paths that if
* added or removed may invalidate this result.
*
* Useful for finding the closest package scope (subpath: package.json,
* type f, breakOnSegment: node_modules) or closest potential package root
* (subpath: node_modules/pkg, type: d) in Node.js resolution.
*/
hierarchicalLookup(mixedStartPath: string, subpath: string, opts: {
breakOnSegment?: null | string;
invalidatedBy?: null | Set<string>;
subpathType?: "f" | "d";
}): null | undefined | {
absolutePath: string;
containerRelativePath: string;
};
/**
* Analogous to posix lstat. If the file at `file` is a symlink, return
* information about the symlink without following it.
*/
linkStats(file: Path): null | undefined | FileStats;
/**
* Return information about the given path, whether a directory or file.
* Always follow symlinks, and return a real path if it exists.
*/
lookup(mixedPath: Path): LookupResult;
matchFiles(opts: {
filter?: RegExp | null;
filterCompareAbsolute?: boolean;
filterComparePosix?: boolean;
follow?: boolean;
recursive?: boolean;
rootDir?: Path | null;
}): Iterable<Path>;
}
export type Glob = string;
export type LookupResult = {
exists: false;
links: ReadonlySet<string>;
missing: string;
} | {
exists: true;
links: ReadonlySet<string>;
realPath: string;
type?: "d" | "f";
};
export interface MockMap {
getMockModule(name: string): null | undefined | Path;
}
export interface HasteConflict {
id: string;
platform?: string | null;
absolutePaths: Array<string>;
type?: "duplicate" | "shadowing";
}
export interface HasteMap {
getModule(name: string, platform?: null | undefined | string, supportsNativePlatform?: null | undefined | boolean, type?: null | undefined | HTypeValue): null | undefined | Path;
getPackage(name: string, platform: null | undefined | string, _supportsNativePlatform: null | undefined | boolean): null | undefined | Path;
computeConflicts(): Array<HasteConflict>;
}
export type HasteMapData = Map<string, HasteMapItem>;
export interface HasteMapItem {
[platform: string]: HasteMapItemMetadata;
}
export type HasteMapItemMetadata = [string, number];
export interface MutableFileSystem extends FileSystem {
remove(filePath: Path): null | undefined | FileMetadata;
addOrModify(filePath: Path, fileMetadata: FileMetadata): void;
bulkAddOrModify(addedOrModifiedFiles: FileData): void;
}
export type Path = string;
export type ProcessFileFunction = (absolutePath: string, metadata: FileMetadata, request: {
readonly computeSha1: boolean;
}) => null | undefined | Buffer;
export interface RawMockMap {
readonly duplicates: Map<string, Set<string>>;
readonly mocks: Map<string, Path>;
readonly version: number;
}
export interface ReadOnlyRawMockMap {
readonly duplicates: ReadonlyMap<string, ReadonlySet<string>>;
readonly mocks: ReadonlyMap<string, Path>;
readonly version: number;
}
export interface WatcherBackend {
getPauseReason(): null | undefined | string;
onError($$PARAM_0$$: (error: Error) => void): () => void;
onFileEvent($$PARAM_0$$: (event: WatcherBackendChangeEvent) => void): () => void;
startWatching(): Promise<void>;
stopWatching(): Promise<void>;
}
export type ChangeEventClock = [string, string];
export type WatcherBackendChangeEvent = {
readonly event: "touch";
readonly clock?: ChangeEventClock;
readonly relativePath: string;
readonly root: string;
readonly metadata: ChangeEventMetadata;
} | {
readonly event: "delete";
readonly clock?: ChangeEventClock;
readonly relativePath: string;
readonly root: string;
readonly metadata?: void;
};
export interface WatcherBackendOptions {
readonly ignored?: null | RegExp;
readonly globs: ReadonlyArray<string>;
readonly dot: boolean;
}
export type WatchmanClockSpec = string | {
readonly scm: {
readonly "mergebase-with": string;
};
};
export type WatchmanClocks = Map<Path, WatchmanClockSpec>;
export interface WorkerMessage {
readonly computeDependencies: boolean;
readonly computeSha1: boolean;
readonly dependencyExtractor?: null | undefined | string;
readonly enableHastePackages: boolean;
readonly filePath: string;
readonly hasteImplModulePath?: null | undefined | string;
readonly maybeReturnContent: boolean;
}
export interface WorkerMetadata {
readonly dependencies?: null | undefined | ReadonlyArray<string>;
readonly id?: null | undefined | string;
readonly sha1?: null | undefined | string;
readonly content?: null | undefined | Buffer;
}
export interface WorkerSetupArgs {}

View File

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

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

@@ -0,0 +1,184 @@
/**
* 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 { BuildParameters, BuildResult, CacheData, CacheManager, CacheManagerFactory, CanonicalPath, ChangeEventClock, ChangeEventMetadata, Console, CrawlerOptions, FileData, FileMapPlugin, FileMetadata, FileSystem, HasteMapData, HasteMapItem, HType, MutableFileSystem, Path, PerfLogger, PerfLoggerFactory, WatchmanClocks } from "./flow-types";
import { FileProcessor } from "./lib/FileProcessor";
import { RootPathUtils } from "./lib/RootPathUtils";
import { Watcher } from "./Watcher";
import EventEmitter from "node:events";
export type { BuildParameters, BuildResult, CacheData, ChangeEventMetadata, FileData, FileMap, FileSystem, HasteMapData, HasteMapItem };
export interface InputOptions {
readonly computeDependencies?: null | undefined | boolean;
readonly computeSha1?: null | undefined | boolean;
readonly enableHastePackages?: boolean;
readonly enableSymlinks?: null | undefined | boolean;
readonly enableWorkerThreads?: null | undefined | boolean;
readonly extensions: ReadonlyArray<string>;
readonly forceNodeFilesystemAPI?: null | undefined | boolean;
readonly ignorePattern?: null | undefined | RegExp;
readonly mocksPattern?: null | undefined | string;
readonly platforms: ReadonlyArray<string>;
readonly plugins?: ReadonlyArray<FileMapPlugin>;
readonly retainAllFiles: boolean;
readonly rootDir: string;
readonly roots: ReadonlyArray<string>;
readonly skipPackageJson?: null | undefined | boolean;
readonly dependencyExtractor?: null | undefined | string;
readonly hasteImplModulePath?: null | undefined | string;
readonly cacheManagerFactory?: null | undefined | CacheManagerFactory;
readonly console?: Console;
readonly healthCheck: HealthCheckOptions;
readonly maxFilesPerWorker?: null | undefined | number;
readonly maxWorkers: number;
readonly perfLoggerFactory?: null | undefined | PerfLoggerFactory;
readonly resetCache?: null | undefined | boolean;
readonly throwOnModuleCollision?: null | undefined | boolean;
readonly useWatchman?: null | undefined | boolean;
readonly watch?: null | undefined | boolean;
readonly watchmanDeferStates?: ReadonlyArray<string>;
}
export interface HealthCheckOptions {
readonly enabled: boolean;
readonly interval: number;
readonly timeout: number;
readonly filePrefix: string;
}
export interface InternalOptions extends BuildParameters {
readonly healthCheck: HealthCheckOptions;
readonly perfLoggerFactory?: null | PerfLoggerFactory;
readonly resetCache?: null | boolean;
readonly useWatchman: boolean;
readonly watch: boolean;
readonly watchmanDeferStates: ReadonlyArray<string>;
}
export { DiskCacheManager } from "./cache/DiskCacheManager";
export { DuplicateHasteCandidatesError } from "./plugins/haste/DuplicateHasteCandidatesError";
export { HasteConflictsError } from "./plugins/haste/HasteConflictsError";
export { default as HastePlugin } from "./plugins/HastePlugin";
export type { HasteMap } from "./flow-types";
export type { HealthCheckResult } from "./Watcher";
export type { CacheManager, CacheManagerFactory, CacheManagerFactoryOptions, CacheManagerWriteOptions, ChangeEvent, DependencyExtractor, WatcherStatus } from "./flow-types";
/**
* FileMap includes a JavaScript implementation of Facebook's haste module system.
*
* This implementation is inspired by https://github.com/facebook/node-haste
* and was built with for high-performance in large code repositories with
* hundreds of thousands of files. This implementation is scalable and provides
* predictable performance.
*
* Because the haste map creation and synchronization is critical to startup
* performance and most tasks are blocked by I/O this class makes heavy use of
* synchronous operations. It uses worker processes for parallelizing file
* access and metadata extraction.
*
* The data structures created by `metro-file-map` can be used directly from the
* cache without further processing. The metadata objects in the `files` and
* `map` objects contain cross-references: a metadata object from one can look
* up the corresponding metadata object in the other map. Note that in most
* projects, the number of files will be greater than the number of haste
* modules one module can refer to many files based on platform extensions.
*
* type CacheData = {
* clocks: WatchmanClocks,
* files: {[filepath: string]: FileMetadata},
* map: {[id: string]: HasteMapItem},
* mocks: {[id: string]: string},
* }
*
* // Watchman clocks are used for query synchronization and file system deltas.
* type WatchmanClocks = {[filepath: string]: string};
*
* type FileMetadata = {
* id: ?string, // used to look up module metadata objects in `map`.
* mtime: number, // check for outdated files.
* size: number, // size of the file in bytes.
* visited: boolean, // whether the file has been parsed or not.
* dependencies: Array<string>, // all relative dependencies of this file.
* sha1: ?string, // SHA-1 of the file, if requested via options.
* symlink: ?(1 | 0 | string), // Truthy if symlink, string is target
* };
*
* // Modules can be targeted to a specific platform based on the file name.
* // Example: platform.ios.js and Platform.android.js will both map to the same
* // `Platform` module. The platform should be specified during resolution.
* type HasteMapItem = {[platform: string]: ModuleMetadata};
*
* //
* type ModuleMetadata = {
* path: string, // the path to look up the file object in `files`.
* type: string, // the module type (either `package` or `module`).
* };
*
* Note that the data structures described above are conceptual only. The actual
* implementation uses arrays and constant keys for metadata storage. Instead of
* `{id: 'flatMap', mtime: 3421, size: 42, visited: true, dependencies: []}` the real
* representation is similar to `['flatMap', 3421, 42, 1, []]` to save storage space
* and reduce parse and write time of a big JSON blob.
*
* The HasteMap is created as follows:
* 1. read data from the cache or create an empty structure.
*
* 2. crawl the file system.
* * empty cache: crawl the entire file system.
* * cache available:
* * if watchman is available: get file system delta changes.
* * if watchman is unavailable: crawl the entire file system.
* * build metadata objects for every file. This builds the `files` part of
* the `HasteMap`.
*
* 3. parse and extract metadata from changed files.
* * this is done in parallel over worker processes to improve performance.
* * the worst case is to parse all files.
* * the best case is no file system access and retrieving all data from
* the cache.
* * the average case is a small number of changed files.
*
* 4. serialize the new `HasteMap` in a cache file.
*
*/
declare class FileMap extends EventEmitter {
_buildPromise: null | undefined | Promise<BuildResult>;
_canUseWatchmanPromise: Promise<boolean>;
_changeID: number;
_changeInterval: null | undefined | NodeJS.Timeout;
_fileProcessor: FileProcessor;
_console: Console;
_options: InternalOptions;
_pathUtils: RootPathUtils;
_watcher: null | undefined | Watcher;
_cacheManager: CacheManager;
_crawlerAbortController: AbortController;
_healthCheckInterval: null | undefined | NodeJS.Timeout;
_startupPerfLogger: null | undefined | PerfLogger;
static create(options: InputOptions): FileMap;
constructor(options: InputOptions);
build(): Promise<BuildResult>;
read(): Promise<null | undefined | CacheData>;
_buildFileDelta(previousState: CrawlerOptions["previousState"]): Promise<{
removedFiles: Set<CanonicalPath>;
changedFiles: FileData;
clocks?: WatchmanClocks;
}>;
_maybeReadLink(filePath: Path, fileMetadata: FileMetadata): null | undefined | Promise<void>;
_applyFileDelta(fileSystem: MutableFileSystem, plugins: ReadonlyArray<FileMapPlugin>, delta: {
readonly changedFiles: FileData;
readonly removedFiles: ReadonlySet<CanonicalPath>;
readonly clocks?: WatchmanClocks;
}): Promise<void>;
_takeSnapshotAndPersist(fileSystem: FileSystem, clocks: WatchmanClocks, plugins: ReadonlyArray<FileMapPlugin>, changed: FileData, removed: Set<CanonicalPath>): Promise<void>;
_watch(fileSystem: MutableFileSystem, clocks: WatchmanClocks, plugins: ReadonlyArray<FileMapPlugin>): Promise<void>;
end(): Promise<void>;
_shouldUseWatchman(): Promise<boolean>;
_getNextChangeID(): number;
_updateClock(clocks: WatchmanClocks, newClock?: null | undefined | ChangeEventClock): void;
static H: HType;
}
export default FileMap;

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

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

View File

@@ -0,0 +1,52 @@
/**
* 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 { FileMetadata, PerfLogger } from "../flow-types";
export interface ProcessFileRequest {
/**
* Populate metadata[H.SHA1] with the SHA1 of the file's contents.
*/
readonly computeSha1: boolean;
/**
* Populate metadata[H.DEPENDENCIES] with unresolved dependency specifiers
* using the dependencyExtractor provided to the constructor.
*/
readonly computeDependencies: boolean;
/**
* Only if processing has already required reading the file's contents, return
* the contents as a Buffer - null otherwise. Not supported for batches.
*/
readonly maybeReturnContent: boolean;
}
export interface MaybeCodedError extends Error {
code?: string;
}
export declare class FileProcessor {
constructor(opts: {
readonly dependencyExtractor?: null | string;
readonly enableHastePackages: boolean;
readonly enableWorkerThreads: boolean;
readonly hasteImplModulePath?: null | string;
readonly maxFilesPerWorker?: null | undefined | number;
readonly maxWorkers: number;
readonly perfLogger?: null | PerfLogger;
});
processBatch(files: ReadonlyArray<[string, FileMetadata]>, req: ProcessFileRequest): Promise<{
errors: Array<{
absolutePath: string;
error: MaybeCodedError;
}>;
}>;
processRegularFile(absolutePath: string, fileMetadata: FileMetadata, req: ProcessFileRequest): null | undefined | {
content?: null | Buffer;
};
end(): Promise<void>;
}

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-file-map/private/lib/FileProcessor");
module.exports.default = module.exports;

View File

@@ -0,0 +1,24 @@
/**
* 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
*
*/
export declare class RootPathUtils {
constructor(rootDir: string);
getBasenameOfNthAncestor(n: number): string;
getParts(): ReadonlyArray<string>;
absoluteToNormal(absolutePath: string): string;
normalToAbsolute(normalPath: string): string;
relativeToNormal(relativePath: string): string;
getAncestorOfRootIdx(normalPath: string): null | undefined | number;
joinNormalToRelative(normalPath: string, relativePath: string): {
normalPath: string;
collapsedSegments: number;
};
relative(from: string, to: string): string;
}

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-file-map/private/lib/RootPathUtils");
module.exports.default = module.exports;

121
node_modules/@expo/metro/metro-file-map/lib/TreeFS.d.ts generated vendored Normal file
View File

@@ -0,0 +1,121 @@
import type { FileData, FileMetadata, FileStats, LookupResult, MutableFileSystem, Path, ProcessFileFunction } from "../flow-types";
type DirectoryNode = Map<string, MixedNode>;
type FileNode = FileMetadata;
type MixedNode = FileNode | DirectoryNode;
export interface NormalizedSymlinkTarget {
ancestorOfRootIdx?: null | number;
normalPath: string;
startOfBasenameIdx: number;
}
declare class TreeFS implements MutableFileSystem {
constructor($$PARAM_0$$: {
rootDir: Path;
files?: FileData;
processFile: ProcessFileFunction;
});
getSerializableSnapshot(): any;
static fromDeserializedSnapshot($$PARAM_0$$: {
rootDir: string;
fileSystemData: DirectoryNode;
processFile: ProcessFileFunction;
}): TreeFS;
getModuleName(mixedPath: Path): null | undefined | string;
getSize(mixedPath: Path): null | undefined | number;
getDependencies(mixedPath: Path): null | undefined | Array<string>;
getDifference(files: FileData): {
changedFiles: FileData;
removedFiles: Set<string>;
};
getSha1(mixedPath: Path): null | undefined | string;
getOrComputeSha1(mixedPath: Path): Promise<null | undefined | {
sha1: string;
content?: Buffer;
}>;
exists(mixedPath: Path): boolean;
lookup(mixedPath: Path): LookupResult;
getAllFiles(): Array<Path>;
linkStats(mixedPath: Path): null | undefined | FileStats;
matchFiles($$PARAM_0$$: {
readonly filter?: null | undefined | RegExp;
readonly filterCompareAbsolute?: boolean;
readonly filterComparePosix?: boolean;
readonly follow?: boolean;
readonly recursive?: boolean;
readonly rootDir?: null | undefined | Path;
}): Iterable<Path>;
addOrModify(mixedPath: Path, metadata: FileMetadata): void;
bulkAddOrModify(addedOrModifiedFiles: FileData): void;
remove(mixedPath: Path): null | undefined | FileMetadata;
_lookupByNormalPath(requestedNormalPath: string, opts: {
collectAncestors?: Array<{
ancestorOfRootIdx?: null | number;
node: DirectoryNode;
normalPath: string;
segmentName: string;
}>;
collectLinkPaths?: null | undefined | Set<string>;
followLeaf?: boolean;
makeDirectories?: boolean;
startPathIdx?: number;
startNode?: DirectoryNode;
start?: {
ancestorOfRootIdx?: null | number;
node: DirectoryNode;
pathIdx: number;
};
}): {
ancestorOfRootIdx?: null | number;
canonicalPath: string;
exists: true;
node: MixedNode;
parentNode: DirectoryNode;
} | {
ancestorOfRootIdx?: null | number;
canonicalPath: string;
exists: true;
node: DirectoryNode;
parentNode: null;
} | {
canonicalMissingPath: string;
missingSegmentName: string;
exists: false;
};
hierarchicalLookup(mixedStartPath: string, subpath: string, opts: {
breakOnSegment?: null | string;
invalidatedBy?: null | Set<string>;
subpathType?: "f" | "d";
}): null | undefined | {
absolutePath: string;
containerRelativePath: string;
};
metadataIterator(opts: {
readonly includeSymlinks: boolean;
readonly includeNodeModules: boolean;
}): Iterable<{
baseName: string;
canonicalPath: string;
metadata: FileMetadata;
}>;
_metadataIterator(rootNode: DirectoryNode, opts: {
readonly includeSymlinks: boolean;
readonly includeNodeModules: boolean;
}, prefix: string): Iterable<{
baseName: string;
canonicalPath: string;
metadata: FileMetadata;
}>;
_normalizePath(relativeOrAbsolutePath: Path): string;
_pathIterator(iterationRootNode: DirectoryNode, iterationRootParentNode: null | undefined | DirectoryNode, ancestorOfRootIdx: null | undefined | number, opts: {
readonly alwaysYieldPosix: boolean;
readonly canonicalPathOfRoot: string;
readonly follow: boolean;
readonly recursive: boolean;
readonly subtreeOnly: boolean;
}, pathPrefix: string, followedLinks: ReadonlySet<FileMetadata>): Iterable<Path>;
_resolveSymlinkTargetToNormalPath(symlinkNode: FileMetadata, canonicalPathOfSymlink: Path): NormalizedSymlinkTarget;
_getFileData(filePath: Path, opts: {
followLeaf: boolean;
}): null | undefined | FileMetadata;
_cloneTree(root: DirectoryNode): DirectoryNode;
}
export default TreeFS;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/lib/TreeFS");

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
*
*/
declare function checkWatchmanCapabilities(requiredCapabilities: ReadonlyArray<string>): Promise<{
version: string;
}>;
export default checkWatchmanCapabilities;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/lib/checkWatchmanCapabilities");

View File

@@ -0,0 +1,11 @@
/**
* 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
*
*/
export declare function extract(code: string): Set<string>;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/lib/dependencyExtractor");

View File

@@ -0,0 +1,12 @@
/**
* 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
*
*/
declare let normalizePathSeparatorsToPosix: (string: string) => string;
export default normalizePathSeparatorsToPosix;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/lib/normalizePathSeparatorsToPosix");

View File

@@ -0,0 +1,12 @@
/**
* 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
*
*/
declare let normalizePathSeparatorsToSystem: (string: string) => string;
export default normalizePathSeparatorsToSystem;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/lib/normalizePathSeparatorsToSystem");

View File

@@ -0,0 +1,17 @@
/**
* 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 { BuildParameters } from "../flow-types";
declare function rootRelativeCacheKeys(buildParameters: BuildParameters): {
rootDirHash: string;
relativeConfigHash: string;
};
export default rootRelativeCacheKeys;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/lib/rootRelativeCacheKeys");

View File

@@ -0,0 +1,12 @@
/**
* 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
*/
export declare function compareStrings(a: null | string, b: null | string): number;
export declare function chainComparators<T>(...comparators: Array<(a: T, b: T) => number>): (a: T, b: T) => number;

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-file-map/private/lib/sorting");
module.exports.default = module.exports;

View File

@@ -0,0 +1,39 @@
/**
* 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 { Console, DuplicatesSet, FileMapDelta, FileMapPlugin, FileMapPluginInitOptions, FileMetadata, HasteConflict, HasteMap, HasteMapItemMetadata, HTypeValue, Path, PerfLogger } from "../flow-types";
export interface HasteMapOptions {
readonly console?: null | undefined | Console;
readonly enableHastePackages: boolean;
readonly perfLogger?: null | PerfLogger;
readonly platforms: ReadonlySet<string>;
readonly rootDir: Path;
readonly failValidationOnConflicts: boolean;
}
declare class HastePlugin implements HasteMap, FileMapPlugin<null> {
readonly name: any;
constructor(options: HasteMapOptions);
initialize($$PARAM_0$$: FileMapPluginInitOptions<null>): Promise<void>;
getSerializableSnapshot(): null;
getModule(name: string, platform?: null | undefined | string, supportsNativePlatform?: null | undefined | boolean, type?: null | undefined | HTypeValue): null | undefined | Path;
getPackage(name: string, platform: null | undefined | string, _supportsNativePlatform?: null | undefined | boolean): null | undefined | Path;
_getModuleMetadata(name: string, platform: null | undefined | string, supportsNativePlatform: boolean): HasteMapItemMetadata | null;
_assertNoDuplicates(name: string, platform: string, supportsNativePlatform: boolean, relativePathSet: null | undefined | DuplicatesSet): void;
bulkUpdate(delta: FileMapDelta): Promise<void>;
onNewOrModifiedFile(relativeFilePath: string, fileMetadata: FileMetadata): void;
setModule(id: string, module: HasteMapItemMetadata): void;
onRemovedFile(relativeFilePath: string, fileMetadata: FileMetadata): void;
assertValid(): void;
_recoverDuplicates(moduleName: string, relativeFilePath: string): void;
computeConflicts(): Array<HasteConflict>;
getCacheKey(): string;
}
export default HastePlugin;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/plugins/HastePlugin");

View File

@@ -0,0 +1,32 @@
/**
* 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 { FileMapDelta, FileMapPlugin, FileMapPluginInitOptions, MockMap as IMockMap, Path, RawMockMap } from "../flow-types";
export declare const CACHE_VERSION: 2;
declare class MockPlugin implements FileMapPlugin<RawMockMap>, IMockMap {
readonly name: any;
constructor($$PARAM_0$$: {
readonly console: typeof console;
readonly mocksPattern: RegExp;
readonly rawMockMap?: RawMockMap;
readonly rootDir: Path;
readonly throwOnModuleCollision: boolean;
});
initialize($$PARAM_0$$: FileMapPluginInitOptions<RawMockMap>): Promise<void>;
getMockModule(name: string): null | undefined | Path;
bulkUpdate(delta: FileMapDelta): Promise<void>;
onNewOrModifiedFile(relativeFilePath: Path): void;
onRemovedFile(relativeFilePath: Path): void;
getSerializableSnapshot(): RawMockMap;
assertValid(): void;
getCacheKey(): string;
}
export default MockPlugin;

Some files were not shown because too many files have changed in this diff Show More