metro 0.76.1 → 0.76.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +21 -23
- package/src/DeltaBundler/Serializers/baseJSBundle.js +1 -0
- package/src/DeltaBundler/Serializers/baseJSBundle.js.flow +1 -0
- package/src/DeltaBundler/Serializers/helpers/js.js +22 -6
- package/src/DeltaBundler/Serializers/helpers/js.js.flow +24 -6
- package/src/DeltaBundler/Serializers/helpers/processModules.js +2 -0
- package/src/DeltaBundler/Serializers/helpers/processModules.js.flow +3 -0
- package/src/DeltaBundler/Serializers/hmrJSBundle.js +1 -0
- package/src/DeltaBundler/Serializers/hmrJSBundle.js.flow +1 -0
- package/src/DeltaBundler/types.d.ts +4 -2
- package/src/Server/symbolicate.js +33 -5
- package/src/Server/symbolicate.js.flow +40 -9
- package/src/Server.js +5 -3
- package/src/Server.js.flow +4 -2
- package/src/index.d.ts +16 -6
- package/src/index.flow.js +9 -2
- package/src/index.flow.js.flow +23 -4
- package/src/node-haste/DependencyGraph.js +6 -1
- package/src/node-haste/DependencyGraph.js.flow +7 -1
- package/src/shared/types.flow.js.flow +0 -1
- package/types/Asset.d.ts +0 -25
- package/types/Bundler.d.ts +0 -39
- package/types/DeltaBundler/Graph.d.ts +0 -40
- package/types/DeltaBundler/Serializers/getRamBundleInfo.d.ts +0 -18
- package/types/DeltaBundler/Worker.d.ts +0 -47
- package/types/DeltaBundler/types.d.ts +0 -167
- package/types/DeltaBundler.d.ts +0 -58
- package/types/IncrementalBundler.d.ts +0 -97
- package/types/ModuleGraph/worker/collectDependencies.d.ts +0 -27
- package/types/Server/MultipartResponse.d.ts +0 -31
- package/types/Server.d.ts +0 -113
- package/types/index.d.ts +0 -151
- package/types/lib/CountingSet.d.ts +0 -48
- package/types/lib/TerminalReporter.d.ts +0 -27
- package/types/lib/contextModule.d.ts +0 -22
- package/types/lib/getGraphId.d.ts +0 -11
- package/types/lib/reporting.d.ts +0 -140
- package/types/node-haste/DependencyGraph.d.ts +0 -59
- package/types/shared/output/bundle.d.ts +0 -31
- package/types/shared/types.d.ts +0 -138
package/types/index.d.ts
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export * from './Asset';
|
|
12
|
-
export * from './DeltaBundler/types';
|
|
13
|
-
export * from './ModuleGraph/worker/collectDependencies';
|
|
14
|
-
export * from './Server';
|
|
15
|
-
export * from './lib/reporting';
|
|
16
|
-
|
|
17
|
-
import type {Server as HttpServer} from 'http';
|
|
18
|
-
import type {Server as HttpsServer} from 'https';
|
|
19
|
-
import type {
|
|
20
|
-
ConfigT,
|
|
21
|
-
InputConfigT,
|
|
22
|
-
loadConfig,
|
|
23
|
-
MetroConfig,
|
|
24
|
-
Middleware,
|
|
25
|
-
} from 'metro-config';
|
|
26
|
-
import type {CustomTransformOptions} from 'metro-babel-transformer';
|
|
27
|
-
import type {ReadOnlyGraph} from './DeltaBundler/types';
|
|
28
|
-
import type {Server} from 'ws';
|
|
29
|
-
import Yargs = require('yargs');
|
|
30
|
-
import type {default as MetroServer, ServerOptions} from './Server';
|
|
31
|
-
import type {OutputOptions, RequestOptions} from './shared/types';
|
|
32
|
-
|
|
33
|
-
export {HttpServer, HttpsServer};
|
|
34
|
-
|
|
35
|
-
interface MetroMiddleWare {
|
|
36
|
-
attachHmrServer: (httpServer: HttpServer | HttpsServer) => void;
|
|
37
|
-
end: () => void;
|
|
38
|
-
metroServer: MetroServer;
|
|
39
|
-
middleware: Middleware;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface RunMetroOptions extends ServerOptions {
|
|
43
|
-
waitForBundler?: boolean;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface RunServerOptions {
|
|
47
|
-
hasReducedPerformance?: boolean;
|
|
48
|
-
host?: string;
|
|
49
|
-
onError?: (error: Error & {code?: string}) => void;
|
|
50
|
-
onReady?: (server: HttpServer | HttpsServer) => void;
|
|
51
|
-
runInspectorProxy?: boolean;
|
|
52
|
-
secureServerOptions?: Record<string, unknown>;
|
|
53
|
-
|
|
54
|
-
/** @deprecated since version 0.61 */
|
|
55
|
-
secure?: boolean;
|
|
56
|
-
|
|
57
|
-
/** @deprecated since version 0.61 */
|
|
58
|
-
secureCert?: string;
|
|
59
|
-
|
|
60
|
-
/** @deprecated since version 0.61 */
|
|
61
|
-
secureKey?: string;
|
|
62
|
-
|
|
63
|
-
waitForBundler?: boolean;
|
|
64
|
-
watch?: boolean;
|
|
65
|
-
websocketEndpoints?: {
|
|
66
|
-
[path: string]: Server;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface RunBuildOptions {
|
|
71
|
-
entry: string;
|
|
72
|
-
dev?: boolean;
|
|
73
|
-
out?: string;
|
|
74
|
-
onBegin?: () => void;
|
|
75
|
-
onComplete?: () => void;
|
|
76
|
-
onProgress?: (transformedFileCount: number, totalFileCount: number) => void;
|
|
77
|
-
minify?: boolean;
|
|
78
|
-
output?: {
|
|
79
|
-
build: (
|
|
80
|
-
server: MetroServer,
|
|
81
|
-
options: RequestOptions,
|
|
82
|
-
) => Promise<{
|
|
83
|
-
code: string;
|
|
84
|
-
map: string;
|
|
85
|
-
}>;
|
|
86
|
-
save: (
|
|
87
|
-
entry: {
|
|
88
|
-
code: string;
|
|
89
|
-
map: string;
|
|
90
|
-
},
|
|
91
|
-
options: OutputOptions,
|
|
92
|
-
postSave: (...args: string[]) => void,
|
|
93
|
-
) => Promise<unknown>;
|
|
94
|
-
};
|
|
95
|
-
platform?: string;
|
|
96
|
-
sourceMap?: boolean;
|
|
97
|
-
sourceMapUrl?: string;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
interface BuildGraphOptions {
|
|
101
|
-
entries: ReadonlyArray<string>;
|
|
102
|
-
customTransformOptions?: CustomTransformOptions;
|
|
103
|
-
dev?: boolean;
|
|
104
|
-
minify?: boolean;
|
|
105
|
-
onProgress?: (transformedFileCount: number, totalFileCount: number) => void;
|
|
106
|
-
platform?: string;
|
|
107
|
-
type?: 'module' | 'script';
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export {MetroConfig};
|
|
111
|
-
|
|
112
|
-
export function runMetro(
|
|
113
|
-
config: InputConfigT,
|
|
114
|
-
options?: RunMetroOptions,
|
|
115
|
-
): Promise<MetroServer>;
|
|
116
|
-
|
|
117
|
-
export {loadConfig};
|
|
118
|
-
|
|
119
|
-
export function createConnectMiddleWare(
|
|
120
|
-
config: ConfigT,
|
|
121
|
-
options?: RunMetroOptions,
|
|
122
|
-
): Promise<MetroMiddleWare>;
|
|
123
|
-
|
|
124
|
-
export function runServer(
|
|
125
|
-
config: ConfigT,
|
|
126
|
-
options: RunServerOptions,
|
|
127
|
-
): Promise<HttpServer | HttpsServer>;
|
|
128
|
-
|
|
129
|
-
export function runBuild(
|
|
130
|
-
config: ConfigT,
|
|
131
|
-
options: RunBuildOptions,
|
|
132
|
-
): Promise<void>;
|
|
133
|
-
|
|
134
|
-
export function buildGraph(
|
|
135
|
-
config: ConfigT,
|
|
136
|
-
options: BuildGraphOptions,
|
|
137
|
-
): Promise<ReadOnlyGraph<void>>;
|
|
138
|
-
|
|
139
|
-
type BuildCommandOptions = Record<string, unknown> | null;
|
|
140
|
-
type ServeCommandOptions = Record<string, unknown> | null;
|
|
141
|
-
|
|
142
|
-
interface AttachMetroCLIOptions {
|
|
143
|
-
build?: BuildCommandOptions;
|
|
144
|
-
serve?: ServeCommandOptions;
|
|
145
|
-
dependencies?: unknown;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export function attachMetroCli(
|
|
149
|
-
yargs: typeof Yargs,
|
|
150
|
-
options?: AttachMetroCLIOptions,
|
|
151
|
-
): typeof Yargs;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export interface ReadOnlyCountingSet<T> extends Iterable<T> {
|
|
12
|
-
has(item: T): boolean;
|
|
13
|
-
[Symbol.iterator](): Iterator<T>;
|
|
14
|
-
readonly size: number;
|
|
15
|
-
count(item: T): number;
|
|
16
|
-
forEach<ThisT>(
|
|
17
|
-
callbackFn: (
|
|
18
|
-
this: ThisT,
|
|
19
|
-
value: T,
|
|
20
|
-
key: T,
|
|
21
|
-
set: ReadOnlyCountingSet<T>,
|
|
22
|
-
) => unknown,
|
|
23
|
-
thisArg: ThisT,
|
|
24
|
-
): void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default class CountingSet<T> implements ReadOnlyCountingSet<T> {
|
|
28
|
-
constructor(items?: Iterable<T>);
|
|
29
|
-
get size(): number;
|
|
30
|
-
has(item: T): boolean;
|
|
31
|
-
add(item: T): void;
|
|
32
|
-
delete(item: T): void;
|
|
33
|
-
keys(): Iterator<T>;
|
|
34
|
-
values(): Iterator<T>;
|
|
35
|
-
[Symbol.iterator](): Iterator<T>;
|
|
36
|
-
count(item: T): number;
|
|
37
|
-
clear(): void;
|
|
38
|
-
forEach<ThisT>(
|
|
39
|
-
callbackFn: (
|
|
40
|
-
this: ThisT,
|
|
41
|
-
value: T,
|
|
42
|
-
key: T,
|
|
43
|
-
set: ReadOnlyCountingSet<T>,
|
|
44
|
-
) => unknown,
|
|
45
|
-
thisArg: ThisT,
|
|
46
|
-
): void;
|
|
47
|
-
toJSON(): unknown;
|
|
48
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import {ReportableEvent} from './reporting';
|
|
12
|
-
import {Terminal} from 'metro-core';
|
|
13
|
-
|
|
14
|
-
export type TerminalReportableEvent =
|
|
15
|
-
| ReportableEvent
|
|
16
|
-
| {
|
|
17
|
-
buildID: string;
|
|
18
|
-
type: 'bundle_transform_progressed_throttled';
|
|
19
|
-
transformedFileCount: number;
|
|
20
|
-
totalFileCount: number;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export class TerminalReporter {
|
|
24
|
-
constructor(terminal: Terminal);
|
|
25
|
-
readonly terminal: Terminal;
|
|
26
|
-
update(event: TerminalReportableEvent): void;
|
|
27
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {ContextMode} from '../ModuleGraph/worker/collectDependencies';
|
|
12
|
-
|
|
13
|
-
export interface RequireContext {
|
|
14
|
-
/* Should search for files recursively. Optional, default `true` when `require.context` is used */
|
|
15
|
-
readonly recursive: boolean;
|
|
16
|
-
/* Filename filter pattern for use in `require.context`. Optional, default `.*` (any file) when `require.context` is used */
|
|
17
|
-
readonly filter: RegExp;
|
|
18
|
-
/** Mode for resolving dynamic dependencies. Defaults to `sync` */
|
|
19
|
-
readonly mode: ContextMode;
|
|
20
|
-
/** Absolute path of the directory to search in */
|
|
21
|
-
readonly from: string;
|
|
22
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export type GraphId = string;
|
package/types/lib/reporting.d.ts
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {HealthCheckResult, WatcherStatus} from 'metro-file-map';
|
|
12
|
-
|
|
13
|
-
export type GlobalCacheDisabledReason = 'too_many_errors' | 'too_many_misses';
|
|
14
|
-
|
|
15
|
-
export interface BundleDetails {
|
|
16
|
-
bundleType: string;
|
|
17
|
-
dev: boolean;
|
|
18
|
-
entryFile: string;
|
|
19
|
-
minify: boolean;
|
|
20
|
-
platform?: string;
|
|
21
|
-
runtimeBytecodeVersion?: number;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* A tagged union of all the actions that may happen and we may want to
|
|
26
|
-
* report to the tool user.
|
|
27
|
-
*/
|
|
28
|
-
export type ReportableEvent =
|
|
29
|
-
| {
|
|
30
|
-
port: number;
|
|
31
|
-
hasReducedPerformance: boolean;
|
|
32
|
-
type: 'initialize_started';
|
|
33
|
-
}
|
|
34
|
-
| {
|
|
35
|
-
type: 'initialize_failed';
|
|
36
|
-
port: number;
|
|
37
|
-
error: Error;
|
|
38
|
-
}
|
|
39
|
-
| {
|
|
40
|
-
buildID: string;
|
|
41
|
-
type: 'bundle_build_done';
|
|
42
|
-
}
|
|
43
|
-
| {
|
|
44
|
-
buildID: string;
|
|
45
|
-
type: 'bundle_build_failed';
|
|
46
|
-
}
|
|
47
|
-
| {
|
|
48
|
-
buildID: string;
|
|
49
|
-
bundleDetails: BundleDetails;
|
|
50
|
-
type: 'bundle_build_started';
|
|
51
|
-
}
|
|
52
|
-
| {
|
|
53
|
-
error: Error;
|
|
54
|
-
type: 'bundling_error';
|
|
55
|
-
}
|
|
56
|
-
| {
|
|
57
|
-
type: 'dep_graph_loading';
|
|
58
|
-
hasReducedPerformance: boolean;
|
|
59
|
-
}
|
|
60
|
-
| {type: 'dep_graph_loaded'}
|
|
61
|
-
| {
|
|
62
|
-
buildID: string;
|
|
63
|
-
type: 'bundle_transform_progressed';
|
|
64
|
-
transformedFileCount: number;
|
|
65
|
-
totalFileCount: number;
|
|
66
|
-
}
|
|
67
|
-
| {
|
|
68
|
-
type: 'global_cache_error';
|
|
69
|
-
error: Error;
|
|
70
|
-
}
|
|
71
|
-
| {
|
|
72
|
-
type: 'global_cache_disabled';
|
|
73
|
-
reason: GlobalCacheDisabledReason;
|
|
74
|
-
}
|
|
75
|
-
| {type: 'transform_cache_reset'}
|
|
76
|
-
| {
|
|
77
|
-
type: 'worker_stdout_chunk';
|
|
78
|
-
chunk: string;
|
|
79
|
-
}
|
|
80
|
-
| {
|
|
81
|
-
type: 'worker_stderr_chunk';
|
|
82
|
-
chunk: string;
|
|
83
|
-
}
|
|
84
|
-
| {
|
|
85
|
-
type: 'hmr_client_error';
|
|
86
|
-
error: Error;
|
|
87
|
-
}
|
|
88
|
-
| {
|
|
89
|
-
type: 'client_log';
|
|
90
|
-
level:
|
|
91
|
-
| 'trace'
|
|
92
|
-
| 'info'
|
|
93
|
-
| 'warn'
|
|
94
|
-
| 'log'
|
|
95
|
-
| 'group'
|
|
96
|
-
| 'groupCollapsed'
|
|
97
|
-
| 'groupEnd'
|
|
98
|
-
| 'debug';
|
|
99
|
-
data: unknown[];
|
|
100
|
-
}
|
|
101
|
-
| {
|
|
102
|
-
type: 'transformer_load_started';
|
|
103
|
-
}
|
|
104
|
-
| {
|
|
105
|
-
type: 'transformer_load_done';
|
|
106
|
-
}
|
|
107
|
-
| {
|
|
108
|
-
type: 'transformer_load_failed';
|
|
109
|
-
error: Error;
|
|
110
|
-
}
|
|
111
|
-
| {
|
|
112
|
-
type: 'watcher_health_check_result';
|
|
113
|
-
result: HealthCheckResult;
|
|
114
|
-
}
|
|
115
|
-
| {
|
|
116
|
-
type: 'watcher_status';
|
|
117
|
-
status: WatcherStatus;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Code across the application takes a reporter as an option and calls the
|
|
122
|
-
* update whenever one of the ReportableEvent happens. Code does not directly
|
|
123
|
-
* write to the standard output, because a build would be:
|
|
124
|
-
*
|
|
125
|
-
* 1. ad-hoc, embedded into another tool, in which case we do not want to
|
|
126
|
-
* pollute that tool's own output. The tool is free to present the
|
|
127
|
-
* warnings/progress we generate any way they want, by specifing a custom
|
|
128
|
-
* reporter.
|
|
129
|
-
* 2. run as a background process from another tool, in which case we want
|
|
130
|
-
* to expose updates in a way that is easily machine-readable, for example
|
|
131
|
-
* a JSON-stream. We don't want to pollute it with textual messages.
|
|
132
|
-
*
|
|
133
|
-
* We centralize terminal reporting into a single place because we want the
|
|
134
|
-
* output to be robust and consistent. The most common reporter is
|
|
135
|
-
* TerminalReporter, that should be the only place in the application should
|
|
136
|
-
* access the `terminal` module (nor the `console`).
|
|
137
|
-
*/
|
|
138
|
-
export interface Reporter {
|
|
139
|
-
update: (event: ReportableEvent) => void;
|
|
140
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import {EventEmitter} from 'events';
|
|
12
|
-
import {ConfigT} from 'metro-config';
|
|
13
|
-
import {ResolverInputOptions} from '../shared/types';
|
|
14
|
-
import {BundlerResolution} from '../DeltaBundler/types';
|
|
15
|
-
|
|
16
|
-
export default class DependencyGraph extends EventEmitter {
|
|
17
|
-
constructor(
|
|
18
|
-
config: ConfigT,
|
|
19
|
-
options?: Readonly<{
|
|
20
|
-
hasReducedPerformance?: boolean;
|
|
21
|
-
watch?: boolean;
|
|
22
|
-
}>,
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
ready(): Promise<void>;
|
|
26
|
-
|
|
27
|
-
/** @deprecated Use the constructor + `ready()` directly */
|
|
28
|
-
load(
|
|
29
|
-
config: ConfigT,
|
|
30
|
-
options?: Readonly<{hasReducedPerformance?: boolean; watch?: boolean}>,
|
|
31
|
-
): Promise<DependencyGraph>;
|
|
32
|
-
|
|
33
|
-
getAllFiles(): string[];
|
|
34
|
-
getSha1(filename: string): string;
|
|
35
|
-
getWatcher(): EventEmitter;
|
|
36
|
-
end(): void;
|
|
37
|
-
|
|
38
|
-
/** Given a search context, return a list of file paths matching the query. */
|
|
39
|
-
matchFilesWithContext(
|
|
40
|
-
from: string,
|
|
41
|
-
context: Readonly<{
|
|
42
|
-
/* Should search for files recursively. */
|
|
43
|
-
recursive: boolean;
|
|
44
|
-
/* Filter relative paths against a pattern. */
|
|
45
|
-
filter: RegExp;
|
|
46
|
-
}>,
|
|
47
|
-
): string[];
|
|
48
|
-
|
|
49
|
-
resolveDependency(
|
|
50
|
-
from: string,
|
|
51
|
-
to: string,
|
|
52
|
-
platform: string | null,
|
|
53
|
-
resolverOptions: ResolverInputOptions,
|
|
54
|
-
options: {assumeFlatNodeModules: boolean},
|
|
55
|
-
): BundlerResolution;
|
|
56
|
-
|
|
57
|
-
getHasteName(filePath: string): string;
|
|
58
|
-
getDependencies(filePath: string): string[];
|
|
59
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import {OutputOptions, RequestOptions} from '../../shared/types';
|
|
12
|
-
import Server from '../../Server';
|
|
13
|
-
|
|
14
|
-
export function build(
|
|
15
|
-
packagerClient: Server,
|
|
16
|
-
requestOptions: RequestOptions,
|
|
17
|
-
): Promise<{
|
|
18
|
-
code: string;
|
|
19
|
-
map: string;
|
|
20
|
-
}>;
|
|
21
|
-
|
|
22
|
-
export function save(
|
|
23
|
-
bundle: {
|
|
24
|
-
code: string;
|
|
25
|
-
map: string;
|
|
26
|
-
},
|
|
27
|
-
options: OutputOptions,
|
|
28
|
-
log: (...args: string[]) => void,
|
|
29
|
-
): Promise<unknown>;
|
|
30
|
-
|
|
31
|
-
export const formatName: string;
|
package/types/shared/types.d.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {TransformProfile} from 'metro-babel-transformer';
|
|
12
|
-
import type {CustomResolverOptions} from 'metro-resolver';
|
|
13
|
-
|
|
14
|
-
import type {
|
|
15
|
-
MetroSourceMapSegmentTuple,
|
|
16
|
-
MixedSourceMap,
|
|
17
|
-
} from 'metro-source-map';
|
|
18
|
-
import type {
|
|
19
|
-
CustomTransformOptions,
|
|
20
|
-
MinifierOptions,
|
|
21
|
-
} from 'metro-transform-worker';
|
|
22
|
-
import type {
|
|
23
|
-
Options as DeltaBundlerOptions,
|
|
24
|
-
TransformInputOptions,
|
|
25
|
-
} from '../DeltaBundler/types';
|
|
26
|
-
|
|
27
|
-
export type BundleType =
|
|
28
|
-
| 'bundle'
|
|
29
|
-
| 'delta'
|
|
30
|
-
| 'meta'
|
|
31
|
-
| 'map'
|
|
32
|
-
| 'ram'
|
|
33
|
-
| 'cli'
|
|
34
|
-
| 'hmr'
|
|
35
|
-
| 'todo'
|
|
36
|
-
| 'graph';
|
|
37
|
-
|
|
38
|
-
type MetroSourceMapOrMappings = MixedSourceMap | MetroSourceMapSegmentTuple[];
|
|
39
|
-
|
|
40
|
-
export interface BundleOptions {
|
|
41
|
-
bundleType: BundleType;
|
|
42
|
-
readonly customResolverOptions: CustomResolverOptions;
|
|
43
|
-
customTransformOptions: CustomTransformOptions;
|
|
44
|
-
dev: boolean;
|
|
45
|
-
entryFile: string;
|
|
46
|
-
readonly excludeSource: boolean;
|
|
47
|
-
readonly hot: boolean;
|
|
48
|
-
readonly inlineSourceMap: boolean;
|
|
49
|
-
minify: boolean;
|
|
50
|
-
readonly modulesOnly: boolean;
|
|
51
|
-
onProgress?: (doneCont: number, totalCount: number) => unknown;
|
|
52
|
-
readonly platform?: string;
|
|
53
|
-
readonly runModule: boolean;
|
|
54
|
-
runtimeBytecodeVersion?: number;
|
|
55
|
-
readonly shallow: boolean;
|
|
56
|
-
sourceMapUrl?: string;
|
|
57
|
-
sourceUrl?: string;
|
|
58
|
-
createModuleIdFactory?: () => (path: string) => number;
|
|
59
|
-
readonly unstable_transformProfile: TransformProfile;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface ResolverInputOptions {
|
|
63
|
-
readonly customResolverOptions?: CustomResolverOptions;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface SerializerOptions {
|
|
67
|
-
readonly sourceMapUrl: string | null;
|
|
68
|
-
readonly sourceUrl: string | null;
|
|
69
|
-
readonly runModule: boolean;
|
|
70
|
-
readonly excludeSource: boolean;
|
|
71
|
-
readonly inlineSourceMap: boolean;
|
|
72
|
-
readonly modulesOnly: boolean;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface GraphOptions {
|
|
76
|
-
readonly shallow: boolean;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Stricter representation of BundleOptions.
|
|
80
|
-
export interface SplitBundleOptions {
|
|
81
|
-
readonly entryFile: string;
|
|
82
|
-
readonly resolverOptions: ResolverInputOptions;
|
|
83
|
-
readonly transformOptions: TransformInputOptions;
|
|
84
|
-
readonly serializerOptions: SerializerOptions;
|
|
85
|
-
readonly graphOptions: GraphOptions;
|
|
86
|
-
readonly onProgress: DeltaBundlerOptions['onProgress'];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface ModuleGroups {
|
|
90
|
-
groups: Map<number, Set<number>>;
|
|
91
|
-
modulesById: Map<number, ModuleTransportLike>;
|
|
92
|
-
modulesInGroups: Set<number>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface ModuleTransportLike {
|
|
96
|
-
readonly code: string;
|
|
97
|
-
readonly id: number;
|
|
98
|
-
readonly map: MetroSourceMapOrMappings | null;
|
|
99
|
-
readonly name?: string;
|
|
100
|
-
readonly sourcePath: string;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface ModuleTransportLikeStrict {
|
|
104
|
-
readonly code: string;
|
|
105
|
-
readonly id: number;
|
|
106
|
-
readonly map: MetroSourceMapOrMappings | null;
|
|
107
|
-
readonly name?: string;
|
|
108
|
-
readonly sourcePath: string;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface RamModuleTransport extends ModuleTransportLikeStrict {
|
|
112
|
-
readonly source: string;
|
|
113
|
-
readonly type: string;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface OutputOptions {
|
|
117
|
-
bundleOutput: string;
|
|
118
|
-
bundleEncoding?: 'utf8' | 'utf16le' | 'ascii';
|
|
119
|
-
dev?: boolean;
|
|
120
|
-
indexedRamBundle?: boolean;
|
|
121
|
-
platform: string;
|
|
122
|
-
sourcemapOutput?: string;
|
|
123
|
-
sourcemapSourcesRoot?: string;
|
|
124
|
-
sourcemapUseAbsolutePath?: boolean;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface RequestOptions {
|
|
128
|
-
entryFile: string;
|
|
129
|
-
inlineSourceMap?: boolean;
|
|
130
|
-
sourceMapUrl?: string;
|
|
131
|
-
dev?: boolean;
|
|
132
|
-
minify: boolean;
|
|
133
|
-
platform: string;
|
|
134
|
-
createModuleIdFactory?: () => (path: string) => number;
|
|
135
|
-
onProgress?: (transformedFileCount: number, totalFileCount: number) => void;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export type {MinifierOptions};
|