metro 0.83.3 → 0.83.5
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 +28 -24
- package/src/Assets.d.ts +83 -0
- package/src/Assets.js +42 -29
- package/src/Assets.js.flow +26 -15
- package/src/Bundler/util.d.ts +27 -0
- package/src/Bundler/util.js +25 -21
- package/src/Bundler/util.js.flow +2 -2
- package/src/Bundler.d.ts +14 -15
- package/src/Bundler.js.flow +1 -1
- package/src/DeltaBundler/DeltaCalculator.d.ts +71 -0
- package/src/DeltaBundler/DeltaCalculator.js +4 -4
- package/src/DeltaBundler/DeltaCalculator.js.flow +8 -8
- package/src/DeltaBundler/Graph.d.ts +135 -8
- package/src/DeltaBundler/Graph.js +16 -16
- package/src/DeltaBundler/Graph.js.flow +30 -30
- package/src/DeltaBundler/Serializers/baseJSBundle.d.ts +20 -0
- package/src/DeltaBundler/Serializers/baseJSBundle.js.flow +1 -1
- package/src/DeltaBundler/Serializers/getAllFiles.d.ts +22 -0
- package/src/DeltaBundler/Serializers/getAllFiles.js.flow +2 -2
- package/src/DeltaBundler/Serializers/getAssets.d.ts +25 -0
- package/src/DeltaBundler/Serializers/getAssets.js.flow +2 -2
- package/src/DeltaBundler/Serializers/getExplodedSourceMap.js.flow +2 -2
- package/src/DeltaBundler/Serializers/getRamBundleInfo.d.ts +36 -6
- package/src/DeltaBundler/Serializers/getRamBundleInfo.js.flow +8 -8
- package/src/DeltaBundler/Serializers/helpers/getInlineSourceMappingURL.d.ts +12 -0
- package/src/DeltaBundler/Serializers/helpers/getSourceMapInfo.d.ts +33 -0
- package/src/DeltaBundler/Serializers/helpers/getTransitiveDependencies.d.ts +17 -0
- package/src/DeltaBundler/Serializers/helpers/js.d.ts +30 -0
- package/src/DeltaBundler/Serializers/helpers/js.js +25 -21
- package/src/DeltaBundler/Serializers/helpers/js.js.flow +6 -6
- package/src/DeltaBundler/Serializers/helpers/processModules.d.ts +25 -0
- package/src/DeltaBundler/Serializers/helpers/processModules.js.flow +3 -3
- package/src/DeltaBundler/Serializers/hmrJSBundle.d.ts +30 -0
- package/src/DeltaBundler/Serializers/hmrJSBundle.js +25 -21
- package/src/DeltaBundler/Serializers/hmrJSBundle.js.flow +5 -5
- package/src/DeltaBundler/Serializers/sourceMapGenerator.d.ts +29 -0
- package/src/DeltaBundler/Serializers/sourceMapGenerator.js.flow +6 -6
- package/src/DeltaBundler/Serializers/sourceMapObject.d.ts +23 -0
- package/src/DeltaBundler/Serializers/sourceMapObject.js.flow +2 -2
- package/src/DeltaBundler/Serializers/sourceMapString.d.ts +22 -0
- package/src/DeltaBundler/Serializers/sourceMapString.js.flow +2 -2
- package/src/DeltaBundler/Transformer.d.ts +38 -0
- package/src/DeltaBundler/Transformer.js.flow +3 -3
- package/src/DeltaBundler/Worker.d.ts +19 -27
- package/src/DeltaBundler/Worker.flow.js.flow +1 -1
- package/src/DeltaBundler/WorkerFarm.d.ts +70 -0
- package/src/DeltaBundler/WorkerFarm.js +1 -1
- package/src/DeltaBundler/WorkerFarm.js.flow +26 -13
- package/src/DeltaBundler/buildSubgraph.d.ts +30 -0
- package/src/DeltaBundler/buildSubgraph.js +4 -4
- package/src/DeltaBundler/buildSubgraph.js.flow +8 -8
- package/src/DeltaBundler/getTransformCacheKey.d.ts +18 -0
- package/src/DeltaBundler/mergeDeltas.d.ts +17 -0
- package/src/DeltaBundler/types.d.ts +97 -100
- package/src/DeltaBundler/types.js.flow +36 -34
- package/src/DeltaBundler.d.ts +14 -12
- package/src/DeltaBundler.js.flow +2 -2
- package/src/HmrServer.d.ts +79 -0
- package/src/HmrServer.js +34 -29
- package/src/HmrServer.js.flow +17 -12
- package/src/IncrementalBundler/GraphNotFoundError.d.ts +17 -0
- package/src/IncrementalBundler/ResourceNotFoundError.d.ts +15 -0
- package/src/IncrementalBundler/RevisionNotFoundError.d.ts +17 -0
- package/src/IncrementalBundler.d.ts +43 -45
- package/src/IncrementalBundler.js +29 -21
- package/src/IncrementalBundler.js.flow +13 -9
- package/src/ModuleGraph/worker/JsFileWrapping.d.ts +29 -0
- package/src/ModuleGraph/worker/JsFileWrapping.js +25 -21
- package/src/ModuleGraph/worker/JsFileWrapping.js.flow +10 -5
- package/src/ModuleGraph/worker/collectDependencies.d.ts +118 -14
- package/src/ModuleGraph/worker/collectDependencies.js +25 -21
- package/src/ModuleGraph/worker/collectDependencies.js.flow +27 -21
- package/src/ModuleGraph/worker/generateImportNames.d.ts +19 -0
- package/src/ModuleGraph/worker/generateImportNames.js.flow +4 -2
- package/src/ModuleGraph/worker/importLocationsPlugin.d.ts +26 -0
- package/src/ModuleGraph/worker/importLocationsPlugin.js.flow +7 -3
- package/src/Server/MultipartResponse.d.ts +5 -6
- package/src/Server/MultipartResponse.js.flow +1 -1
- package/src/Server/symbolicate.js.flow +4 -4
- package/src/Server.d.ts +220 -67
- package/src/Server.js +149 -45
- package/src/Server.js.flow +167 -57
- package/src/cli/parseKeyValueParamArray.d.ts +14 -0
- package/src/cli/parseKeyValueParamArray.js.flow +1 -1
- package/src/cli-utils.d.ts +19 -0
- package/src/cli-utils.js.flow +2 -2
- package/src/commands/build.d.ts +16 -0
- package/src/commands/build.js.flow +11 -10
- package/src/commands/dependencies.d.ts +16 -0
- package/src/commands/dependencies.js.flow +8 -4
- package/src/commands/serve.d.ts +16 -0
- package/src/commands/serve.js +2 -0
- package/src/commands/serve.js.flow +14 -9
- package/src/index.d.ts +97 -110
- package/src/index.flow.js +53 -35
- package/src/index.flow.js.flow +49 -29
- package/src/integration_tests/basic_bundle/AssetRegistry.js.flow +1 -1
- package/src/integration_tests/basic_bundle/ErrorBundle.js.flow +1 -1
- package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-import.js.flow +1 -1
- package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-multi-line-import-with-escapes.js.flow +1 -1
- package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-multi-line-import.js.flow +1 -1
- package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-require-with-embedded-comment.js.flow +1 -1
- package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-require.js.flow +1 -1
- package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-specifier-with-escapes.js.flow +1 -1
- package/src/integration_tests/basic_bundle/build-errors/inline-requires-cannot-resolve-import.js.flow +1 -1
- package/src/integration_tests/basic_bundle/build-errors/inline-requires-cannot-resolve-require.js.flow +1 -1
- package/src/integration_tests/basic_bundle/import-export/index.js +25 -21
- package/src/integration_tests/basic_bundle/import-export/index.js.flow +3 -3
- package/src/integration_tests/basic_bundle/import-export/utils.js.flow +2 -2
- package/src/integration_tests/basic_bundle/loadBundleAsyncForTest.js.flow +1 -1
- package/src/integration_tests/basic_bundle/optional-dependencies/index.js.flow +1 -1
- package/src/integration_tests/basic_bundle/require-context/conflict.js.flow +1 -1
- package/src/integration_tests/basic_bundle/require-context/empty.js.flow +1 -1
- package/src/integration_tests/basic_bundle/require-context/matching.js.flow +1 -1
- package/src/integration_tests/basic_bundle/require-context/mode-eager.js.flow +1 -1
- package/src/integration_tests/basic_bundle/require-context/mode-lazy-once.js.flow +1 -1
- package/src/integration_tests/basic_bundle/require-context/mode-lazy.js.flow +1 -1
- package/src/integration_tests/basic_bundle/require-context/mode-sync.js.flow +2 -2
- package/src/integration_tests/basic_bundle/require-context/utils.js.flow +1 -1
- package/src/integration_tests/basic_bundle/require-resolveWeak/import-and-resolveWeak.js.flow +1 -1
- package/src/integration_tests/basic_bundle/require-resolveWeak/multiple.js.flow +1 -1
- package/src/integration_tests/basic_bundle/require-resolveWeak/never-required.js.flow +1 -1
- package/src/integration_tests/basic_bundle/require-resolveWeak/require-and-resolveWeak.js.flow +1 -1
- package/src/integration_tests/execBundle.js.flow +1 -1
- package/src/lib/BatchProcessor.d.ts +54 -0
- package/src/lib/BatchProcessor.js +5 -2
- package/src/lib/BatchProcessor.js.flow +10 -7
- package/src/lib/CountingSet.d.ts +10 -10
- package/src/lib/CountingSet.js.flow +4 -4
- package/src/lib/JsonReporter.d.ts +37 -0
- package/src/lib/JsonReporter.js +5 -3
- package/src/lib/JsonReporter.js.flow +19 -17
- package/src/lib/RamBundleParser.d.ts +29 -0
- package/src/lib/RamBundleParser.js.flow +1 -1
- package/src/lib/TerminalReporter.d.ts +97 -6
- package/src/lib/TerminalReporter.js +37 -34
- package/src/lib/TerminalReporter.js.flow +21 -30
- package/src/lib/bundleProgressUtils.d.ts +26 -0
- package/src/lib/bundleProgressUtils.js +19 -0
- package/src/lib/bundleProgressUtils.js.flow +35 -0
- package/src/lib/bundleToString.d.ts +19 -0
- package/src/lib/contextModule.d.ts +20 -9
- package/src/lib/contextModule.js.flow +1 -1
- package/src/lib/contextModuleTemplates.d.ts +25 -0
- package/src/lib/contextModuleTemplates.js +25 -21
- package/src/lib/countLines.d.ts +12 -0
- package/src/lib/countLines.js +4 -3
- package/src/lib/countLines.js.flow +3 -4
- package/src/lib/createWebsocketServer.d.ts +43 -0
- package/src/lib/createWebsocketServer.js +9 -2
- package/src/lib/createWebsocketServer.js.flow +16 -9
- package/src/lib/debounceAsyncQueue.d.ts +15 -0
- package/src/lib/debounceAsyncQueue.js.flow +1 -1
- package/src/lib/formatBundlingError.d.ts +23 -0
- package/src/lib/formatBundlingError.js.flow +1 -1
- package/src/lib/getAppendScripts.d.ts +31 -0
- package/src/lib/getAppendScripts.js.flow +4 -4
- package/src/lib/getGraphId.d.ts +15 -1
- package/src/lib/getGraphId.js.flow +1 -1
- package/src/lib/getPreludeCode.d.ts +18 -0
- package/src/lib/getPreludeCode.js +4 -0
- package/src/lib/getPreludeCode.js.flow +10 -3
- package/src/lib/getPrependedScripts.d.ts +24 -0
- package/src/lib/getPrependedScripts.js +36 -22
- package/src/lib/getPrependedScripts.js.flow +10 -3
- package/src/lib/isResolvedDependency.d.ts +15 -0
- package/src/lib/logToConsole.d.ts +19 -0
- package/src/lib/logToConsole.js.flow +2 -2
- package/src/lib/parseBundleOptionsFromBundleRequestUrl.d.ts +17 -0
- package/src/lib/parseBundleOptionsFromBundleRequestUrl.js +25 -21
- package/src/lib/parseCustomResolverOptions.d.ts +16 -0
- package/src/lib/parseCustomResolverOptions.js.flow +2 -2
- package/src/lib/parseCustomTransformOptions.d.ts +16 -0
- package/src/lib/parseCustomTransformOptions.js.flow +1 -1
- package/src/lib/parseJsonBody.d.ts +27 -0
- package/src/lib/parseJsonBody.js.flow +11 -1
- package/src/lib/pathUtils.d.ts +14 -0
- package/src/lib/pathUtils.js +25 -21
- package/src/lib/pathUtils.js.flow +1 -1
- package/src/lib/relativizeSourceMap.d.ts +17 -0
- package/src/lib/reporting.d.ts +65 -81
- package/src/lib/reporting.js.flow +4 -4
- package/src/lib/splitBundleOptions.d.ts +16 -0
- package/src/lib/transformHelpers.d.ts +35 -0
- package/src/lib/transformHelpers.js +11 -9
- package/src/lib/transformHelpers.js.flow +17 -15
- package/src/node-haste/DependencyGraph/ModuleResolution.d.ts +126 -0
- package/src/node-haste/DependencyGraph/ModuleResolution.js +48 -42
- package/src/node-haste/DependencyGraph/ModuleResolution.js.flow +35 -32
- package/src/node-haste/DependencyGraph/createFileMap.d.ts +29 -0
- package/src/node-haste/DependencyGraph/createFileMap.js +56 -38
- package/src/node-haste/DependencyGraph/createFileMap.js.flow +44 -18
- package/src/node-haste/DependencyGraph.d.ts +57 -33
- package/src/node-haste/DependencyGraph.js +40 -31
- package/src/node-haste/DependencyGraph.js.flow +35 -37
- package/src/node-haste/Package.d.ts +21 -0
- package/src/node-haste/PackageCache.d.ts +34 -0
- package/src/node-haste/lib/AssetPaths.d.ts +29 -0
- package/src/node-haste/lib/AssetPaths.js +2 -2
- package/src/node-haste/lib/AssetPaths.js.flow +4 -4
- package/src/node-haste/lib/parsePlatformFilePath.d.ts +25 -0
- package/src/node-haste/lib/parsePlatformFilePath.js +6 -6
- package/src/node-haste/lib/parsePlatformFilePath.js.flow +4 -4
- package/src/shared/output/RamBundle/as-assets.d.ts +25 -0
- package/src/shared/output/RamBundle/as-assets.js.flow +6 -6
- package/src/shared/output/RamBundle/as-indexed-file.d.ts +38 -0
- package/src/shared/output/RamBundle/as-indexed-file.js.flow +5 -5
- package/src/shared/output/RamBundle/buildSourcemapWithMetadata.d.ts +23 -0
- package/src/shared/output/RamBundle/buildSourcemapWithMetadata.js.flow +5 -5
- package/src/shared/output/RamBundle/magic-number.d.ts +14 -0
- package/src/shared/output/RamBundle/util.d.ts +41 -0
- package/src/shared/output/RamBundle/util.js.flow +5 -5
- package/src/shared/output/RamBundle/write-sourcemap.d.ts +16 -0
- package/src/shared/output/RamBundle/write-sourcemap.js.flow +1 -1
- package/src/shared/output/RamBundle.d.ts +26 -0
- package/src/shared/output/RamBundle.js.flow +1 -1
- package/src/shared/output/bundle.d.ts +9 -17
- package/src/shared/output/bundle.flow.js.flow +3 -3
- package/src/shared/output/meta.d.ts +15 -0
- package/src/shared/output/meta.js +2 -2
- package/src/shared/output/meta.js.flow +1 -1
- package/src/shared/output/unbundle.d.ts +11 -0
- package/src/shared/output/writeFile.d.ts +16 -0
- package/src/shared/output/writeFile.js +8 -3
- package/src/shared/output/writeFile.js.flow +8 -2
- package/src/shared/types.d.ts +81 -66
- package/src/shared/types.js.flow +20 -5
- package/src/Asset.d.ts +0 -25
- package/src/ModuleGraph/test-helpers.js +0 -75
|
@@ -22,7 +22,7 @@ import {sourceMapObject} from './sourceMapObject';
|
|
|
22
22
|
import nullthrows from 'nullthrows';
|
|
23
23
|
import path from 'path';
|
|
24
24
|
|
|
25
|
-
type Options =
|
|
25
|
+
type Options = Readonly<{
|
|
26
26
|
...SerializerOptions,
|
|
27
27
|
...SourceMapGeneratorOptions,
|
|
28
28
|
getTransformOptions: ?GetTransformOptions,
|
|
@@ -31,18 +31,18 @@ type Options = $ReadOnly<{
|
|
|
31
31
|
|
|
32
32
|
export type RamBundleInfo = {
|
|
33
33
|
getDependencies: string => Set<string>,
|
|
34
|
-
startupModules:
|
|
35
|
-
lazyModules:
|
|
34
|
+
startupModules: ReadonlyArray<ModuleTransportLike>,
|
|
35
|
+
lazyModules: ReadonlyArray<ModuleTransportLike>,
|
|
36
36
|
groups: Map<number, Set<number>>,
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export default async function getRamBundleInfo(
|
|
40
40
|
entryPoint: string,
|
|
41
|
-
pre:
|
|
41
|
+
pre: ReadonlyArray<Module<>>,
|
|
42
42
|
graph: ReadOnlyGraph<>,
|
|
43
43
|
options: Options,
|
|
44
44
|
): Promise<RamBundleInfo> {
|
|
45
|
-
let modules:
|
|
45
|
+
let modules: ReadonlyArray<Module<>> = [
|
|
46
46
|
...pre,
|
|
47
47
|
...graph.dependencies.values(),
|
|
48
48
|
];
|
|
@@ -142,9 +142,9 @@ async function _getRamOptions(
|
|
|
142
142
|
getDependencies: string => Iterable<string>,
|
|
143
143
|
getTransformOptions: ?GetTransformOptions,
|
|
144
144
|
): Promise<
|
|
145
|
-
|
|
146
|
-
preloadedModules:
|
|
147
|
-
ramGroups:
|
|
145
|
+
Readonly<{
|
|
146
|
+
preloadedModules: Readonly<{[string]: true, ...}>,
|
|
147
|
+
ramGroups: ReadonlyArray<string>,
|
|
148
148
|
}>,
|
|
149
149
|
> {
|
|
150
150
|
if (getTransformOptions == null) {
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
declare function getInlineSourceMappingURL(sourceMap: string): string;
|
|
12
|
+
export default getInlineSourceMappingURL;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 {Module} from '../../types';
|
|
12
|
+
import type {
|
|
13
|
+
FBSourceFunctionMap,
|
|
14
|
+
MetroSourceMapSegmentTuple,
|
|
15
|
+
} from 'metro-source-map';
|
|
16
|
+
|
|
17
|
+
declare function getSourceMapInfo(
|
|
18
|
+
module: Module,
|
|
19
|
+
options: {
|
|
20
|
+
readonly excludeSource: boolean;
|
|
21
|
+
readonly shouldAddToIgnoreList: ($$PARAM_0$$: Module) => boolean;
|
|
22
|
+
getSourceUrl: null | undefined | ((module: Module) => string);
|
|
23
|
+
},
|
|
24
|
+
): {
|
|
25
|
+
readonly map: Array<MetroSourceMapSegmentTuple>;
|
|
26
|
+
readonly functionMap: null | undefined | FBSourceFunctionMap;
|
|
27
|
+
readonly code: string;
|
|
28
|
+
readonly path: string;
|
|
29
|
+
readonly source: string;
|
|
30
|
+
readonly lineCount: number;
|
|
31
|
+
readonly isIgnored: boolean;
|
|
32
|
+
};
|
|
33
|
+
export default getSourceMapInfo;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 {ReadOnlyGraph} from '../../types';
|
|
12
|
+
|
|
13
|
+
declare function getTransitiveDependencies<T>(
|
|
14
|
+
path: string,
|
|
15
|
+
graph: ReadOnlyGraph<T>,
|
|
16
|
+
): Set<string>;
|
|
17
|
+
export default getTransitiveDependencies;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 {MixedOutput, Module} from '../../types';
|
|
12
|
+
import type {JsOutput} from 'metro-transform-worker';
|
|
13
|
+
|
|
14
|
+
export type Options = Readonly<{
|
|
15
|
+
createModuleId: ($$PARAM_0$$: string) => number | string;
|
|
16
|
+
dev: boolean;
|
|
17
|
+
includeAsyncPaths: boolean;
|
|
18
|
+
projectRoot: string;
|
|
19
|
+
serverRoot: string;
|
|
20
|
+
sourceUrl: null | undefined | string;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function wrapModule(module: Module, options: Options): string;
|
|
23
|
+
export declare function getModuleParams(
|
|
24
|
+
module: Module,
|
|
25
|
+
options: Options,
|
|
26
|
+
): Array<unknown>;
|
|
27
|
+
export declare function getJsOutput(
|
|
28
|
+
module: Readonly<{output: ReadonlyArray<MixedOutput>; path?: string}>,
|
|
29
|
+
): JsOutput;
|
|
30
|
+
export declare function isJsModule(module: Module): boolean;
|
|
@@ -13,28 +13,32 @@ var _invariant = _interopRequireDefault(require("invariant"));
|
|
|
13
13
|
var jscSafeUrl = _interopRequireWildcard(require("jsc-safe-url"));
|
|
14
14
|
var _metroTransformPlugins = require("metro-transform-plugins");
|
|
15
15
|
var _path = _interopRequireDefault(require("path"));
|
|
16
|
-
function
|
|
17
|
-
if ("function"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var n = { __proto__: null },
|
|
31
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
32
|
-
for (var u in e)
|
|
33
|
-
if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
34
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
35
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : (n[u] = e[u]);
|
|
16
|
+
function _interopRequireWildcard(e, t) {
|
|
17
|
+
if ("function" == typeof WeakMap)
|
|
18
|
+
var r = new WeakMap(),
|
|
19
|
+
n = new WeakMap();
|
|
20
|
+
return (_interopRequireWildcard = function (e, t) {
|
|
21
|
+
if (!t && e && e.__esModule) return e;
|
|
22
|
+
var o,
|
|
23
|
+
i,
|
|
24
|
+
f = { __proto__: null, default: e };
|
|
25
|
+
if (null === e || ("object" != typeof e && "function" != typeof e))
|
|
26
|
+
return f;
|
|
27
|
+
if ((o = t ? n : r)) {
|
|
28
|
+
if (o.has(e)) return o.get(e);
|
|
29
|
+
o.set(e, f);
|
|
36
30
|
}
|
|
37
|
-
|
|
31
|
+
for (const t in e)
|
|
32
|
+
"default" !== t &&
|
|
33
|
+
{}.hasOwnProperty.call(e, t) &&
|
|
34
|
+
((i =
|
|
35
|
+
(o = Object.defineProperty) &&
|
|
36
|
+
Object.getOwnPropertyDescriptor(e, t)) &&
|
|
37
|
+
(i.get || i.set)
|
|
38
|
+
? o(f, t, i)
|
|
39
|
+
: (f[t] = e[t]));
|
|
40
|
+
return f;
|
|
41
|
+
})(e, t);
|
|
38
42
|
}
|
|
39
43
|
function _interopRequireDefault(e) {
|
|
40
44
|
return e && e.__esModule ? e : { default: e };
|
|
@@ -19,7 +19,7 @@ import * as jscSafeUrl from 'jsc-safe-url';
|
|
|
19
19
|
import {addParamsToDefineCall} from 'metro-transform-plugins';
|
|
20
20
|
import path from 'path';
|
|
21
21
|
|
|
22
|
-
export type Options =
|
|
22
|
+
export type Options = Readonly<{
|
|
23
23
|
createModuleId: string => number | string,
|
|
24
24
|
dev: boolean,
|
|
25
25
|
includeAsyncPaths: boolean,
|
|
@@ -43,10 +43,10 @@ export function wrapModule(module: Module<>, options: Options): string {
|
|
|
43
43
|
export function getModuleParams(
|
|
44
44
|
module: Module<>,
|
|
45
45
|
options: Options,
|
|
46
|
-
): Array<
|
|
46
|
+
): Array<unknown> {
|
|
47
47
|
const moduleId = options.createModuleId(module.path);
|
|
48
48
|
|
|
49
|
-
const paths: {[moduleID: number | string]:
|
|
49
|
+
const paths: {[moduleID: number | string]: unknown} = {};
|
|
50
50
|
let hasPaths = false;
|
|
51
51
|
const dependencyMapArray = Array.from(module.dependencies.values()).map(
|
|
52
52
|
dependency => {
|
|
@@ -118,8 +118,8 @@ export function getModuleParams(
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
export function getJsOutput(
|
|
121
|
-
module:
|
|
122
|
-
output:
|
|
121
|
+
module: Readonly<{
|
|
122
|
+
output: ReadonlyArray<MixedOutput>,
|
|
123
123
|
path?: string,
|
|
124
124
|
...
|
|
125
125
|
}>,
|
|
@@ -133,7 +133,7 @@ export function getJsOutput(
|
|
|
133
133
|
} has ${jsModules.length} JS outputs.`,
|
|
134
134
|
);
|
|
135
135
|
|
|
136
|
-
const jsOutput: JsOutput =
|
|
136
|
+
const jsOutput: JsOutput = jsModules[0] as any;
|
|
137
137
|
|
|
138
138
|
invariant(
|
|
139
139
|
Number.isFinite(jsOutput.data.lineCount),
|
|
@@ -0,0 +1,25 @@
|
|
|
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 {Module} from '../../types';
|
|
12
|
+
|
|
13
|
+
declare function processModules(
|
|
14
|
+
modules: ReadonlyArray<Module>,
|
|
15
|
+
$$PARAM_1$$: Readonly<{
|
|
16
|
+
filter?: (module: Module) => boolean;
|
|
17
|
+
createModuleId: ($$PARAM_0$$: string) => number;
|
|
18
|
+
dev: boolean;
|
|
19
|
+
includeAsyncPaths: boolean;
|
|
20
|
+
projectRoot: string;
|
|
21
|
+
serverRoot: string;
|
|
22
|
+
sourceUrl: null | undefined | string;
|
|
23
|
+
}>,
|
|
24
|
+
): ReadonlyArray<[Module, string]>;
|
|
25
|
+
export default processModules;
|
|
@@ -14,7 +14,7 @@ import type {Module} from '../../types';
|
|
|
14
14
|
import {isJsModule, wrapModule} from './js';
|
|
15
15
|
|
|
16
16
|
export default function processModules(
|
|
17
|
-
modules:
|
|
17
|
+
modules: ReadonlyArray<Module<>>,
|
|
18
18
|
{
|
|
19
19
|
filter = () => true,
|
|
20
20
|
createModuleId,
|
|
@@ -23,7 +23,7 @@ export default function processModules(
|
|
|
23
23
|
projectRoot,
|
|
24
24
|
serverRoot,
|
|
25
25
|
sourceUrl,
|
|
26
|
-
}:
|
|
26
|
+
}: Readonly<{
|
|
27
27
|
filter?: (module: Module<>) => boolean,
|
|
28
28
|
createModuleId: string => number,
|
|
29
29
|
dev: boolean,
|
|
@@ -32,7 +32,7 @@ export default function processModules(
|
|
|
32
32
|
serverRoot: string,
|
|
33
33
|
sourceUrl: ?string,
|
|
34
34
|
}>,
|
|
35
|
-
):
|
|
35
|
+
): ReadonlyArray<[Module<>, string]> {
|
|
36
36
|
return [...modules]
|
|
37
37
|
.filter(isJsModule)
|
|
38
38
|
.filter(filter)
|
|
@@ -0,0 +1,30 @@
|
|
|
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 {DeltaResult, ReadOnlyGraph} from '../types';
|
|
12
|
+
import type {HmrModule} from 'metro-runtime/src/modules/types';
|
|
13
|
+
|
|
14
|
+
type Options = Readonly<{
|
|
15
|
+
clientUrl: URL;
|
|
16
|
+
createModuleId: ($$PARAM_0$$: string) => number;
|
|
17
|
+
includeAsyncPaths: boolean;
|
|
18
|
+
projectRoot: string;
|
|
19
|
+
serverRoot: string;
|
|
20
|
+
}>;
|
|
21
|
+
declare function hmrJSBundle(
|
|
22
|
+
delta: DeltaResult,
|
|
23
|
+
graph: ReadOnlyGraph,
|
|
24
|
+
options: Options,
|
|
25
|
+
): {
|
|
26
|
+
readonly added: ReadonlyArray<HmrModule>;
|
|
27
|
+
readonly deleted: ReadonlyArray<number>;
|
|
28
|
+
readonly modified: ReadonlyArray<HmrModule>;
|
|
29
|
+
};
|
|
30
|
+
export default hmrJSBundle;
|
|
@@ -11,28 +11,32 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
11
11
|
function _interopRequireDefault(e) {
|
|
12
12
|
return e && e.__esModule ? e : { default: e };
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
if ("function"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var n = { __proto__: null },
|
|
29
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
30
|
-
for (var u in e)
|
|
31
|
-
if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
32
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
33
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : (n[u] = e[u]);
|
|
14
|
+
function _interopRequireWildcard(e, t) {
|
|
15
|
+
if ("function" == typeof WeakMap)
|
|
16
|
+
var r = new WeakMap(),
|
|
17
|
+
n = new WeakMap();
|
|
18
|
+
return (_interopRequireWildcard = function (e, t) {
|
|
19
|
+
if (!t && e && e.__esModule) return e;
|
|
20
|
+
var o,
|
|
21
|
+
i,
|
|
22
|
+
f = { __proto__: null, default: e };
|
|
23
|
+
if (null === e || ("object" != typeof e && "function" != typeof e))
|
|
24
|
+
return f;
|
|
25
|
+
if ((o = t ? n : r)) {
|
|
26
|
+
if (o.has(e)) return o.get(e);
|
|
27
|
+
o.set(e, f);
|
|
34
28
|
}
|
|
35
|
-
|
|
29
|
+
for (const t in e)
|
|
30
|
+
"default" !== t &&
|
|
31
|
+
{}.hasOwnProperty.call(e, t) &&
|
|
32
|
+
((i =
|
|
33
|
+
(o = Object.defineProperty) &&
|
|
34
|
+
Object.getOwnPropertyDescriptor(e, t)) &&
|
|
35
|
+
(i.get || i.set)
|
|
36
|
+
? o(f, t, i)
|
|
37
|
+
: (f[t] = e[t]));
|
|
38
|
+
return f;
|
|
39
|
+
})(e, t);
|
|
36
40
|
}
|
|
37
41
|
const debug = require("debug")("Metro:HMR");
|
|
38
42
|
function generateModules(sourceModules, graph, options) {
|
|
@@ -20,7 +20,7 @@ import path from 'path';
|
|
|
20
20
|
// eslint-disable-next-line import/no-commonjs
|
|
21
21
|
const debug = require('debug')('Metro:HMR');
|
|
22
22
|
|
|
23
|
-
type Options =
|
|
23
|
+
type Options = Readonly<{
|
|
24
24
|
clientUrl: URL,
|
|
25
25
|
createModuleId: string => number,
|
|
26
26
|
includeAsyncPaths: boolean,
|
|
@@ -33,7 +33,7 @@ function generateModules(
|
|
|
33
33
|
sourceModules: Iterable<Module<>>,
|
|
34
34
|
graph: ReadOnlyGraph<>,
|
|
35
35
|
options: Options,
|
|
36
|
-
):
|
|
36
|
+
): ReadonlyArray<HmrModule> {
|
|
37
37
|
const modules = [];
|
|
38
38
|
|
|
39
39
|
for (const module of sourceModules) {
|
|
@@ -148,9 +148,9 @@ export default function hmrJSBundle(
|
|
|
148
148
|
graph: ReadOnlyGraph<>,
|
|
149
149
|
options: Options,
|
|
150
150
|
): {
|
|
151
|
-
+added:
|
|
152
|
-
+deleted:
|
|
153
|
-
+modified:
|
|
151
|
+
+added: ReadonlyArray<HmrModule>,
|
|
152
|
+
+deleted: ReadonlyArray<number>,
|
|
153
|
+
+modified: ReadonlyArray<HmrModule>,
|
|
154
154
|
} {
|
|
155
155
|
return {
|
|
156
156
|
added: generateModules(delta.added.values(), graph, options),
|
|
@@ -0,0 +1,29 @@
|
|
|
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 {Module} from '../types';
|
|
12
|
+
|
|
13
|
+
import {fromRawMappings, fromRawMappingsNonBlocking} from 'metro-source-map';
|
|
14
|
+
|
|
15
|
+
export type SourceMapGeneratorOptions = Readonly<{
|
|
16
|
+
excludeSource: boolean;
|
|
17
|
+
processModuleFilter: (module: Module) => boolean;
|
|
18
|
+
shouldAddToIgnoreList: (module: Module) => boolean;
|
|
19
|
+
getSourceUrl: null | undefined | ((module: Module) => string);
|
|
20
|
+
}>;
|
|
21
|
+
declare function sourceMapGenerator(
|
|
22
|
+
modules: ReadonlyArray<Module>,
|
|
23
|
+
options: SourceMapGeneratorOptions,
|
|
24
|
+
): ReturnType<typeof fromRawMappings>;
|
|
25
|
+
declare function sourceMapGeneratorNonBlocking(
|
|
26
|
+
modules: ReadonlyArray<Module>,
|
|
27
|
+
options: SourceMapGeneratorOptions,
|
|
28
|
+
): ReturnType<typeof fromRawMappingsNonBlocking>;
|
|
29
|
+
export {sourceMapGenerator, sourceMapGeneratorNonBlocking};
|
|
@@ -15,7 +15,7 @@ import getSourceMapInfo from './helpers/getSourceMapInfo';
|
|
|
15
15
|
import {isJsModule} from './helpers/js';
|
|
16
16
|
import {fromRawMappings, fromRawMappingsNonBlocking} from 'metro-source-map';
|
|
17
17
|
|
|
18
|
-
export type SourceMapGeneratorOptions =
|
|
18
|
+
export type SourceMapGeneratorOptions = Readonly<{
|
|
19
19
|
excludeSource: boolean,
|
|
20
20
|
processModuleFilter: (module: Module<>) => boolean,
|
|
21
21
|
shouldAddToIgnoreList: (module: Module<>) => boolean,
|
|
@@ -24,8 +24,8 @@ export type SourceMapGeneratorOptions = $ReadOnly<{
|
|
|
24
24
|
|
|
25
25
|
function getSourceMapInfosImpl(
|
|
26
26
|
isBlocking: boolean,
|
|
27
|
-
onDone: (
|
|
28
|
-
modules:
|
|
27
|
+
onDone: (ReadonlyArray<ReturnType<typeof getSourceMapInfo>>) => void,
|
|
28
|
+
modules: ReadonlyArray<Module<>>,
|
|
29
29
|
options: SourceMapGeneratorOptions,
|
|
30
30
|
): void {
|
|
31
31
|
const sourceMapInfos = [];
|
|
@@ -76,7 +76,7 @@ function getSourceMapInfosImpl(
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
function sourceMapGenerator(
|
|
79
|
-
modules:
|
|
79
|
+
modules: ReadonlyArray<Module<>>,
|
|
80
80
|
options: SourceMapGeneratorOptions,
|
|
81
81
|
): ReturnType<typeof fromRawMappings> {
|
|
82
82
|
let sourceMapInfos;
|
|
@@ -97,11 +97,11 @@ function sourceMapGenerator(
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
async function sourceMapGeneratorNonBlocking(
|
|
100
|
-
modules:
|
|
100
|
+
modules: ReadonlyArray<Module<>>,
|
|
101
101
|
options: SourceMapGeneratorOptions,
|
|
102
102
|
): ReturnType<typeof fromRawMappingsNonBlocking> {
|
|
103
103
|
const sourceMapInfos = await new Promise<
|
|
104
|
-
|
|
104
|
+
ReadonlyArray<ReturnType<typeof getSourceMapInfo>>,
|
|
105
105
|
>(resolve => {
|
|
106
106
|
getSourceMapInfosImpl(false, resolve, modules, options);
|
|
107
107
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
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 {Module} from '../types';
|
|
12
|
+
import type {SourceMapGeneratorOptions} from './sourceMapGenerator';
|
|
13
|
+
import type {MixedSourceMap} from 'metro-source-map';
|
|
14
|
+
|
|
15
|
+
declare function sourceMapObject(
|
|
16
|
+
modules: ReadonlyArray<Module>,
|
|
17
|
+
options: SourceMapGeneratorOptions,
|
|
18
|
+
): MixedSourceMap;
|
|
19
|
+
declare function sourceMapObjectNonBlocking(
|
|
20
|
+
modules: ReadonlyArray<Module>,
|
|
21
|
+
options: SourceMapGeneratorOptions,
|
|
22
|
+
): Promise<MixedSourceMap>;
|
|
23
|
+
export {sourceMapObject, sourceMapObjectNonBlocking};
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from './sourceMapGenerator';
|
|
20
20
|
|
|
21
21
|
function sourceMapObject(
|
|
22
|
-
modules:
|
|
22
|
+
modules: ReadonlyArray<Module<>>,
|
|
23
23
|
options: SourceMapGeneratorOptions,
|
|
24
24
|
): MixedSourceMap {
|
|
25
25
|
const generator = sourceMapGenerator(modules, options);
|
|
@@ -29,7 +29,7 @@ function sourceMapObject(
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
async function sourceMapObjectNonBlocking(
|
|
32
|
-
modules:
|
|
32
|
+
modules: ReadonlyArray<Module<>>,
|
|
33
33
|
options: SourceMapGeneratorOptions,
|
|
34
34
|
): Promise<MixedSourceMap> {
|
|
35
35
|
const generator = await sourceMapGeneratorNonBlocking(modules, options);
|
|
@@ -0,0 +1,22 @@
|
|
|
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 {Module} from '../types';
|
|
12
|
+
import type {SourceMapGeneratorOptions} from './sourceMapGenerator';
|
|
13
|
+
|
|
14
|
+
declare function sourceMapString(
|
|
15
|
+
modules: ReadonlyArray<Module>,
|
|
16
|
+
options: SourceMapGeneratorOptions,
|
|
17
|
+
): string;
|
|
18
|
+
declare function sourceMapStringNonBlocking(
|
|
19
|
+
modules: ReadonlyArray<Module>,
|
|
20
|
+
options: SourceMapGeneratorOptions,
|
|
21
|
+
): Promise<string>;
|
|
22
|
+
export {sourceMapString, sourceMapStringNonBlocking};
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from './sourceMapGenerator';
|
|
19
19
|
|
|
20
20
|
function sourceMapString(
|
|
21
|
-
modules:
|
|
21
|
+
modules: ReadonlyArray<Module<>>,
|
|
22
22
|
options: SourceMapGeneratorOptions,
|
|
23
23
|
): string {
|
|
24
24
|
return sourceMapGenerator(modules, options).toString(undefined, {
|
|
@@ -27,7 +27,7 @@ function sourceMapString(
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async function sourceMapStringNonBlocking(
|
|
30
|
-
modules:
|
|
30
|
+
modules: ReadonlyArray<Module<>>,
|
|
31
31
|
options: SourceMapGeneratorOptions,
|
|
32
32
|
): Promise<string> {
|
|
33
33
|
const generator = await sourceMapGeneratorNonBlocking(modules, options);
|
|
@@ -0,0 +1,38 @@
|
|
|
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 {TransformResult, TransformResultWithSource} from '../DeltaBundler';
|
|
12
|
+
import type {TransformOptions} from './Worker';
|
|
13
|
+
import type {ConfigT} from 'metro-config';
|
|
14
|
+
|
|
15
|
+
import WorkerFarm from './WorkerFarm';
|
|
16
|
+
import {Cache} from 'metro-cache';
|
|
17
|
+
|
|
18
|
+
type GetOrComputeSha1Fn = (
|
|
19
|
+
$$PARAM_0$$: string,
|
|
20
|
+
) => Promise<Readonly<{content?: Buffer; sha1: string}>>;
|
|
21
|
+
declare class Transformer {
|
|
22
|
+
_config: ConfigT;
|
|
23
|
+
_cache: Cache<TransformResult>;
|
|
24
|
+
_baseHash: string;
|
|
25
|
+
_getSha1: GetOrComputeSha1Fn;
|
|
26
|
+
_workerFarm: WorkerFarm;
|
|
27
|
+
constructor(
|
|
28
|
+
config: ConfigT,
|
|
29
|
+
opts: Readonly<{getOrComputeSha1: GetOrComputeSha1Fn}>,
|
|
30
|
+
);
|
|
31
|
+
transformFile(
|
|
32
|
+
filePath: string,
|
|
33
|
+
transformerOptions: TransformOptions,
|
|
34
|
+
fileBuffer?: Buffer,
|
|
35
|
+
): Promise<TransformResultWithSource>;
|
|
36
|
+
end(): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
export default Transformer;
|
|
@@ -26,7 +26,7 @@ import path from 'path';
|
|
|
26
26
|
const debug = require('debug')('Metro:Transformer');
|
|
27
27
|
|
|
28
28
|
type GetOrComputeSha1Fn = string => Promise<
|
|
29
|
-
|
|
29
|
+
Readonly<{content?: Buffer, sha1: string}>,
|
|
30
30
|
>;
|
|
31
31
|
|
|
32
32
|
export default class Transformer {
|
|
@@ -38,7 +38,7 @@ export default class Transformer {
|
|
|
38
38
|
|
|
39
39
|
constructor(
|
|
40
40
|
config: ConfigT,
|
|
41
|
-
opts:
|
|
41
|
+
opts: Readonly<{getOrComputeSha1: GetOrComputeSha1Fn}>,
|
|
42
42
|
) {
|
|
43
43
|
this._config = config;
|
|
44
44
|
|
|
@@ -160,7 +160,7 @@ export default class Transformer {
|
|
|
160
160
|
|
|
161
161
|
// A valid result from the cache is used directly; otherwise we call into
|
|
162
162
|
// the transformer to computed the corresponding result.
|
|
163
|
-
const data:
|
|
163
|
+
const data: Readonly<{
|
|
164
164
|
result: TransformResult<>,
|
|
165
165
|
sha1: string,
|
|
166
166
|
}> = result
|