metro 0.66.2 → 0.69.0
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 +22 -24
- package/src/Assets.js +9 -9
- package/src/Assets.js.flow +5 -7
- package/src/Bundler/util.js +16 -15
- package/src/Bundler/util.js.flow +11 -10
- package/src/Bundler.js +21 -8
- package/src/Bundler.js.flow +19 -7
- package/src/DeltaBundler/DeltaCalculator.js +15 -15
- package/src/DeltaBundler/DeltaCalculator.js.flow +7 -7
- package/src/DeltaBundler/Serializers/baseBytecodeBundle.js +13 -13
- package/src/DeltaBundler/Serializers/baseBytecodeBundle.js.flow +6 -7
- package/src/DeltaBundler/Serializers/baseJSBundle.js +4 -4
- package/src/DeltaBundler/Serializers/baseJSBundle.js.flow +4 -4
- package/src/DeltaBundler/Serializers/getAllFiles.js +1 -1
- package/src/DeltaBundler/Serializers/getAllFiles.js.flow +3 -3
- package/src/DeltaBundler/Serializers/getAssets.js +3 -3
- package/src/DeltaBundler/Serializers/getAssets.js.flow +4 -5
- package/src/DeltaBundler/Serializers/getExplodedSourceMap.js +4 -4
- package/src/DeltaBundler/Serializers/getExplodedSourceMap.js.flow +4 -4
- package/src/DeltaBundler/Serializers/getRamBundleInfo.js +20 -20
- package/src/DeltaBundler/Serializers/getRamBundleInfo.js.flow +9 -10
- package/src/DeltaBundler/Serializers/helpers/bytecode.js +11 -11
- package/src/DeltaBundler/Serializers/helpers/bytecode.js.flow +5 -6
- package/src/DeltaBundler/Serializers/helpers/getInlineSourceMappingURL.js +1 -1
- package/src/DeltaBundler/Serializers/helpers/getInlineSourceMappingURL.js.flow +1 -1
- package/src/DeltaBundler/Serializers/helpers/getSourceMapInfo.js +2 -2
- package/src/DeltaBundler/Serializers/helpers/getSourceMapInfo.js.flow +4 -4
- package/src/DeltaBundler/Serializers/helpers/getTransitiveDependencies.js +1 -1
- package/src/DeltaBundler/Serializers/helpers/getTransitiveDependencies.js.flow +1 -1
- package/src/DeltaBundler/Serializers/helpers/js.js +6 -6
- package/src/DeltaBundler/Serializers/helpers/js.js.flow +11 -12
- package/src/DeltaBundler/Serializers/helpers/processBytecodeModules.js +4 -4
- package/src/DeltaBundler/Serializers/helpers/processBytecodeModules.js.flow +3 -3
- package/src/DeltaBundler/Serializers/helpers/processModules.js +4 -4
- package/src/DeltaBundler/Serializers/helpers/processModules.js.flow +3 -3
- package/src/DeltaBundler/Serializers/hmrJSBundle.js +9 -9
- package/src/DeltaBundler/Serializers/hmrJSBundle.js.flow +9 -8
- package/src/DeltaBundler/Serializers/sourceMapGenerator.js +6 -6
- package/src/DeltaBundler/Serializers/sourceMapGenerator.js.flow +3 -4
- package/src/DeltaBundler/Serializers/sourceMapObject.js +5 -5
- package/src/DeltaBundler/Serializers/sourceMapObject.js.flow +4 -4
- package/src/DeltaBundler/Serializers/sourceMapString.js +2 -2
- package/src/DeltaBundler/Serializers/sourceMapString.js.flow +3 -3
- package/src/DeltaBundler/Transformer.js +9 -9
- package/src/DeltaBundler/Transformer.js.flow +7 -9
- package/src/DeltaBundler/Worker.js +8 -11
- package/src/DeltaBundler/Worker.js.flow +8 -11
- package/src/DeltaBundler/WorkerFarm.js +14 -17
- package/src/DeltaBundler/WorkerFarm.js.flow +7 -10
- package/src/DeltaBundler/__fixtures__/hasteImpl.js +2 -2
- package/src/DeltaBundler/computeDelta.js +2 -2
- package/src/DeltaBundler/computeDelta.js.flow +2 -2
- package/src/DeltaBundler/getTransformCacheKey.js +4 -4
- package/src/DeltaBundler/getTransformCacheKey.js.flow +5 -6
- package/src/DeltaBundler/mergeDeltas.js +2 -2
- package/src/DeltaBundler/mergeDeltas.js.flow +1 -1
- package/src/DeltaBundler/traverseDependencies.js +22 -22
- package/src/DeltaBundler/traverseDependencies.js.flow +3 -3
- package/src/DeltaBundler/types.flow.js +1 -1
- package/src/DeltaBundler/types.flow.js.flow +1 -1
- package/src/DeltaBundler.js +5 -5
- package/src/DeltaBundler.js.flow +4 -4
- package/src/HmrServer.js +71 -55
- package/src/HmrServer.js.flow +40 -37
- package/src/IncrementalBundler/GraphNotFoundError.js +1 -1
- package/src/IncrementalBundler/GraphNotFoundError.js.flow +1 -1
- package/src/IncrementalBundler/ResourceNotFoundError.js +1 -1
- package/src/IncrementalBundler/ResourceNotFoundError.js.flow +1 -1
- package/src/IncrementalBundler/RevisionNotFoundError.js +1 -1
- package/src/IncrementalBundler/RevisionNotFoundError.js.flow +1 -1
- package/src/IncrementalBundler.js +44 -32
- package/src/IncrementalBundler.js.flow +30 -24
- package/src/ModuleGraph/module.js +3 -3
- package/src/ModuleGraph/module.js.flow +1 -1
- package/src/ModuleGraph/node-haste/HasteFS.js +2 -2
- package/src/ModuleGraph/node-haste/HasteFS.js.flow +1 -1
- package/src/ModuleGraph/node-haste/Module.js +1 -1
- package/src/ModuleGraph/node-haste/Module.js.flow +1 -1
- package/src/ModuleGraph/node-haste/ModuleCache.js +1 -1
- package/src/ModuleGraph/node-haste/ModuleCache.js.flow +3 -3
- package/src/ModuleGraph/node-haste/Package.js +3 -3
- package/src/ModuleGraph/node-haste/Package.js.flow +3 -3
- package/src/ModuleGraph/node-haste/node-haste.flow.js +1 -1
- package/src/ModuleGraph/node-haste/node-haste.flow.js.flow +1 -1
- package/src/ModuleGraph/node-haste/node-haste.js +42 -32
- package/src/ModuleGraph/node-haste/node-haste.js.flow +28 -23
- package/src/ModuleGraph/output/indexed-ram-bundle.js +17 -17
- package/src/ModuleGraph/output/indexed-ram-bundle.js.flow +41 -9
- package/src/ModuleGraph/output/multiple-files-ram-bundle.js +18 -18
- package/src/ModuleGraph/output/multiple-files-ram-bundle.js.flow +21 -9
- package/src/ModuleGraph/output/plain-bundle.js +6 -6
- package/src/ModuleGraph/output/plain-bundle.js.flow +7 -7
- package/src/ModuleGraph/output/reverse-dependency-map-references.js +3 -3
- package/src/ModuleGraph/output/reverse-dependency-map-references.js.flow +4 -8
- package/src/ModuleGraph/output/util.js +31 -30
- package/src/ModuleGraph/output/util.js.flow +15 -16
- package/src/ModuleGraph/silent-console.js +2 -2
- package/src/ModuleGraph/silent-console.js.flow +1 -1
- package/src/ModuleGraph/test-helpers.js +7 -7
- package/src/ModuleGraph/types.flow.js +1 -1
- package/src/ModuleGraph/types.flow.js.flow +7 -7
- package/src/ModuleGraph/worker/JsFileWrapping.js +7 -7
- package/src/ModuleGraph/worker/JsFileWrapping.js.flow +3 -2
- package/src/ModuleGraph/worker/Platforms.js +2 -2
- package/src/ModuleGraph/worker/Platforms.js.flow +1 -1
- package/src/ModuleGraph/worker/collectDependencies.js +24 -25
- package/src/ModuleGraph/worker/collectDependencies.js.flow +15 -17
- package/src/ModuleGraph/worker/generate.js +2 -2
- package/src/ModuleGraph/worker/generate.js.flow +3 -3
- package/src/ModuleGraph/worker/generateImportNames.js +5 -5
- package/src/ModuleGraph/worker/generateImportNames.js.flow +3 -5
- package/src/ModuleGraph/worker/mergeSourceMaps.js +8 -7
- package/src/ModuleGraph/worker/mergeSourceMaps.js.flow +3 -3
- package/src/Server/MultipartResponse.js +4 -8
- package/src/Server/symbolicate.js +8 -8
- package/src/Server/symbolicate.js.flow +17 -5
- package/src/Server.js +202 -150
- package/src/Server.js.flow +129 -87
- package/src/cli-utils.js +4 -4
- package/src/cli-utils.js.flow +15 -13
- package/src/cli.js +4 -4
- package/src/cli.js.flow +2 -4
- package/src/commands/build.js +23 -24
- package/src/commands/build.js.flow +6 -9
- package/src/commands/dependencies.js +25 -19
- package/src/commands/serve.js +17 -18
- package/src/commands/serve.js.flow +6 -9
- package/src/index.js +116 -51
- package/src/index.js.flow +107 -41
- package/src/integration_tests/basic_bundle/AssetRegistry.js +2 -2
- package/src/integration_tests/basic_bundle/AssetRegistry.js.flow +1 -1
- package/src/integration_tests/basic_bundle/Bar.js +2 -2
- package/src/integration_tests/basic_bundle/Bar.js.flow +1 -1
- package/src/integration_tests/basic_bundle/ErrorBundle.js +2 -2
- package/src/integration_tests/basic_bundle/ErrorBundle.js.flow +1 -1
- package/src/integration_tests/basic_bundle/Foo.js +2 -2
- package/src/integration_tests/basic_bundle/Foo.js.flow +1 -1
- package/src/integration_tests/basic_bundle/TestBundle.js +3 -2
- package/src/integration_tests/basic_bundle/TestBundle.js.flow +3 -1
- package/src/integration_tests/basic_bundle/TestPolyfill.js +1 -1
- package/src/integration_tests/basic_bundle/TestPolyfill.js.flow +1 -1
- package/src/integration_tests/basic_bundle/TypeScript.ts +1 -1
- package/src/integration_tests/basic_bundle/import-export/export-1.js +2 -2
- package/src/integration_tests/basic_bundle/import-export/export-1.js.flow +1 -1
- package/src/integration_tests/basic_bundle/import-export/export-2.js +2 -2
- package/src/integration_tests/basic_bundle/import-export/export-2.js.flow +1 -1
- package/src/integration_tests/basic_bundle/import-export/export-3.js +2 -2
- package/src/integration_tests/basic_bundle/import-export/export-3.js.flow +1 -1
- package/src/integration_tests/basic_bundle/import-export/export-4.js +2 -2
- package/src/integration_tests/basic_bundle/import-export/export-4.js.flow +1 -1
- package/src/integration_tests/basic_bundle/import-export/export-5.js +2 -2
- package/src/integration_tests/basic_bundle/import-export/export-5.js.flow +1 -1
- package/src/integration_tests/basic_bundle/import-export/export-6.js +2 -2
- package/src/integration_tests/basic_bundle/import-export/export-6.js.flow +1 -1
- package/src/integration_tests/basic_bundle/import-export/export-null.js +2 -2
- package/src/integration_tests/basic_bundle/import-export/export-null.js.flow +1 -1
- package/src/integration_tests/basic_bundle/import-export/export-primitive-default.js +2 -2
- package/src/integration_tests/basic_bundle/import-export/export-primitive-default.js.flow +1 -1
- package/src/integration_tests/basic_bundle/import-export/index.js +8 -8
- package/src/integration_tests/basic_bundle/import-export/index.js.flow +1 -1
- package/src/integration_tests/basic_bundle/polyfill.js +1 -1
- package/src/integration_tests/execBundle.js +2 -2
- package/src/integration_tests/execBundle.js.flow +1 -1
- package/src/integration_tests/metro.config.js +8 -8
- package/src/lib/BatchProcessor.js +3 -3
- package/src/lib/BatchProcessor.js.flow +1 -1
- package/src/lib/JsonReporter.js +2 -2
- package/src/lib/JsonReporter.js.flow +1 -1
- package/src/lib/RamBundleParser.js +1 -1
- package/src/lib/RamBundleParser.js.flow +1 -1
- package/src/lib/TerminalReporter.js +14 -14
- package/src/lib/TerminalReporter.js.flow +9 -10
- package/src/lib/bundleToBytecode.js +6 -7
- package/src/lib/bundleToBytecode.js.flow +8 -7
- package/src/lib/bundleToString.js +3 -3
- package/src/lib/bundleToString.js.flow +5 -4
- package/src/lib/countLines.js +3 -7
- package/src/lib/countLines.js.flow +4 -7
- package/src/lib/createModuleIdFactory.js +2 -2
- package/src/lib/createModuleIdFactory.js.flow +1 -1
- package/src/lib/{attachWebsocketServer.js → createWebsocketServer.js} +18 -17
- package/src/lib/{attachWebsocketServer.js.flow → createWebsocketServer.js.flow} +12 -21
- package/src/lib/debounceAsyncQueue.js +2 -2
- package/src/lib/debounceAsyncQueue.js.flow +1 -1
- package/src/lib/formatBundlingError.js +21 -21
- package/src/lib/formatBundlingError.js.flow +6 -8
- package/src/lib/getAppendScripts.js +26 -27
- package/src/lib/getAppendScripts.js.flow +7 -8
- package/src/lib/getGraphId.js +3 -3
- package/src/lib/getGraphId.js.flow +3 -3
- package/src/lib/getMaxWorkers.js +2 -2
- package/src/lib/getMaxWorkers.js.flow +1 -1
- package/src/lib/getPreludeCode.js +2 -2
- package/src/lib/getPreludeCode.js.flow +1 -1
- package/src/lib/getPrependedScripts.js +15 -15
- package/src/lib/getPrependedScripts.js.flow +7 -8
- package/src/lib/logToConsole.js +1 -1
- package/src/lib/logToConsole.js.flow +3 -3
- package/src/lib/parseCustomTransformOptions.js +2 -2
- package/src/lib/parseCustomTransformOptions.js.flow +3 -3
- package/src/lib/parseOptionsFromUrl.js +7 -7
- package/src/lib/parseOptionsFromUrl.js.flow +29 -9
- package/src/lib/relativizeSourceMap.js +1 -1
- package/src/lib/relativizeSourceMap.js.flow +3 -3
- package/src/lib/reporting.js +5 -5
- package/src/lib/reporting.js.flow +16 -3
- package/src/lib/splitBundleOptions.js +5 -5
- package/src/lib/splitBundleOptions.js.flow +1 -1
- package/src/lib/transformHelpers.js +10 -10
- package/src/lib/transformHelpers.js.flow +5 -5
- package/src/node-haste/DependencyGraph/ModuleResolution.js +51 -30
- package/src/node-haste/DependencyGraph/ModuleResolution.js.flow +46 -42
- package/src/node-haste/DependencyGraph/createHasteMap.js +99 -0
- package/src/node-haste/DependencyGraph/createHasteMap.js.flow +88 -0
- package/src/node-haste/DependencyGraph/{assets/empty-module.js → types.js} +2 -2
- package/src/node-haste/DependencyGraph/types.js.flow +88 -0
- package/src/node-haste/DependencyGraph.js +49 -117
- package/src/node-haste/DependencyGraph.js.flow +36 -111
- package/src/node-haste/Module.js +1 -1
- package/src/node-haste/Module.js.flow +3 -3
- package/src/node-haste/ModuleCache.js +54 -13
- package/src/node-haste/ModuleCache.js.flow +53 -12
- package/src/node-haste/Package.js +7 -9
- package/src/node-haste/Package.js.flow +1 -8
- package/src/node-haste/lib/AssetPaths.js +5 -5
- package/src/node-haste/lib/AssetPaths.js.flow +2 -4
- package/src/node-haste/lib/parsePlatformFilePath.js +4 -4
- package/src/node-haste/lib/parsePlatformFilePath.js.flow +1 -1
- package/src/shared/output/RamBundle/as-assets.js +16 -17
- package/src/shared/output/RamBundle/as-assets.js.flow +11 -15
- package/src/shared/output/RamBundle/as-indexed-file.js +14 -15
- package/src/shared/output/RamBundle/as-indexed-file.js.flow +8 -12
- package/src/shared/output/RamBundle/buildSourcemapWithMetadata.js +7 -7
- package/src/shared/output/RamBundle/buildSourcemapWithMetadata.js.flow +4 -4
- package/src/shared/output/RamBundle/magic-number.js +1 -1
- package/src/shared/output/RamBundle/magic-number.js.flow +1 -1
- package/src/shared/output/RamBundle/util.js +21 -19
- package/src/shared/output/RamBundle/util.js.flow +5 -8
- package/src/shared/output/RamBundle/write-sourcemap.js +1 -1
- package/src/shared/output/RamBundle/write-sourcemap.js.flow +1 -1
- package/src/shared/output/RamBundle.js +2 -2
- package/src/shared/output/RamBundle.js.flow +4 -5
- package/src/shared/output/bundle.js +6 -6
- package/src/shared/output/bundle.js.flow +4 -5
- package/src/shared/output/meta.js +4 -5
- package/src/shared/output/meta.js.flow +2 -4
- package/src/shared/output/unbundle.js +1 -1
- package/src/shared/output/unbundle.js.flow +1 -1
- package/src/shared/output/writeFile.js +1 -1
- package/src/shared/output/writeFile.js.flow +1 -1
- package/src/shared/types.flow.js +1 -1
- package/src/shared/types.flow.js.flow +2 -2
- package/src/node-haste/DependencyGraph/assets/empty-module.js.flow +0 -9
- package/src/node-haste/types.js +0 -10
- package/src/node-haste/types.js.flow +0 -23
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -8,33 +8,28 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import type {HasteFS, HasteMap, ModuleMap} from './DependencyGraph/types';
|
|
12
|
+
import type Package from './Package';
|
|
13
|
+
import type {ConfigT} from 'metro-config/src/configTypes.flow';
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
const {DuplicateHasteCandidatesError} = require('jest-haste-map').ModuleMap;
|
|
15
|
-
const {InvalidPackageError} = require('metro-resolver');
|
|
16
|
-
const {PackageResolutionError} = require('metro-core');
|
|
15
|
+
import {ModuleMap as JestHasteModuleMap} from 'jest-haste-map';
|
|
17
16
|
|
|
18
|
-
const
|
|
17
|
+
const createHasteMap = require('./DependencyGraph/createHasteMap');
|
|
18
|
+
const {ModuleResolver} = require('./DependencyGraph/ModuleResolution');
|
|
19
19
|
const Module = require('./Module');
|
|
20
20
|
const ModuleCache = require('./ModuleCache');
|
|
21
|
-
|
|
22
|
-
const ci = require('ci-info');
|
|
23
|
-
const fs = require('fs');
|
|
24
|
-
const path = require('path');
|
|
25
|
-
|
|
26
|
-
const {ModuleResolver} = require('./DependencyGraph/ModuleResolution');
|
|
27
21
|
const {EventEmitter} = require('events');
|
|
22
|
+
const fs = require('fs');
|
|
28
23
|
const {
|
|
24
|
+
AmbiguousModuleResolutionError,
|
|
29
25
|
Logger: {createActionStartEntry, createActionEndEntry, log},
|
|
26
|
+
PackageResolutionError,
|
|
30
27
|
} = require('metro-core');
|
|
28
|
+
const {InvalidPackageError} = require('metro-resolver');
|
|
29
|
+
const nullthrows = require('nullthrows');
|
|
30
|
+
const path = require('path');
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
import type Package from './Package';
|
|
34
|
-
import type {HasteFS} from './types';
|
|
35
|
-
import type {ConfigT} from 'metro-config/src/configTypes.flow';
|
|
36
|
-
|
|
37
|
-
const JEST_HASTE_MAP_CACHE_BREAKER = 5;
|
|
32
|
+
const {DuplicateHasteCandidatesError} = JestHasteModuleMap;
|
|
38
33
|
|
|
39
34
|
function getOrCreate<T>(
|
|
40
35
|
map: Map<string, Map<string, T>>,
|
|
@@ -51,8 +46,7 @@ function getOrCreate<T>(
|
|
|
51
46
|
class DependencyGraph extends EventEmitter {
|
|
52
47
|
_assetExtensions: Set<string>;
|
|
53
48
|
_config: ConfigT;
|
|
54
|
-
|
|
55
|
-
_haste: JestHasteMap;
|
|
49
|
+
_haste: HasteMap;
|
|
56
50
|
_hasteFS: HasteFS;
|
|
57
51
|
_moduleCache: ModuleCache;
|
|
58
52
|
_moduleMap: ModuleMap;
|
|
@@ -66,8 +60,7 @@ class DependencyGraph extends EventEmitter {
|
|
|
66
60
|
initialModuleMap,
|
|
67
61
|
}: {|
|
|
68
62
|
+config: ConfigT,
|
|
69
|
-
|
|
70
|
-
+haste: JestHasteMap,
|
|
63
|
+
+haste: HasteMap,
|
|
71
64
|
+initialHasteFS: HasteFS,
|
|
72
65
|
+initialModuleMap: ModuleMap,
|
|
73
66
|
|}) {
|
|
@@ -86,84 +79,25 @@ class DependencyGraph extends EventEmitter {
|
|
|
86
79
|
this._createModuleResolver();
|
|
87
80
|
}
|
|
88
81
|
|
|
89
|
-
static _getIgnorePattern(config: ConfigT): RegExp {
|
|
90
|
-
/*
|
|
91
|
-
For now we support both blockList and blacklistRE options
|
|
92
|
-
*/
|
|
93
|
-
const {blockList, blacklistRE} = config.resolver;
|
|
94
|
-
|
|
95
|
-
const combine = regexes =>
|
|
96
|
-
new RegExp(
|
|
97
|
-
regexes
|
|
98
|
-
.map(regex => '(' + regex.source.replace(/\//g, path.sep) + ')')
|
|
99
|
-
.join('|'),
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
// If `blacklistRE` is set - use it,
|
|
103
|
-
// if `blockList` is set - use it
|
|
104
|
-
const ignorePattern = blacklistRE || blockList;
|
|
105
|
-
|
|
106
|
-
// If neither option has been set, use default pattern
|
|
107
|
-
if (!ignorePattern) {
|
|
108
|
-
return / ^/;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// If ignorePattern is an array, merge it into one
|
|
112
|
-
if (Array.isArray(ignorePattern)) {
|
|
113
|
-
return combine(ignorePattern);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return ignorePattern;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// $FlowFixMe[value-as-type]
|
|
120
|
-
static _createHaste(config: ConfigT, watch?: boolean): JestHasteMap {
|
|
121
|
-
const haste = new JestHasteMap({
|
|
122
|
-
cacheDirectory: config.hasteMapCacheDirectory,
|
|
123
|
-
dependencyExtractor: config.resolver.dependencyExtractor,
|
|
124
|
-
computeSha1: true,
|
|
125
|
-
extensions: config.resolver.sourceExts.concat(config.resolver.assetExts),
|
|
126
|
-
forceNodeFilesystemAPI: !config.resolver.useWatchman,
|
|
127
|
-
hasteImplModulePath: config.resolver.hasteImplModulePath,
|
|
128
|
-
ignorePattern: this._getIgnorePattern(config),
|
|
129
|
-
maxWorkers: config.maxWorkers,
|
|
130
|
-
mocksPattern: '',
|
|
131
|
-
name: 'metro-' + JEST_HASTE_MAP_CACHE_BREAKER,
|
|
132
|
-
platforms: config.resolver.platforms,
|
|
133
|
-
retainAllFiles: true,
|
|
134
|
-
resetCache: config.resetCache,
|
|
135
|
-
rootDir: config.projectRoot,
|
|
136
|
-
roots: config.watchFolders,
|
|
137
|
-
throwOnModuleCollision: true,
|
|
138
|
-
useWatchman: config.resolver.useWatchman,
|
|
139
|
-
watch: watch == null ? !ci.isCI : watch,
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
// We can have a lot of graphs listening to Haste for changes.
|
|
143
|
-
// Bump this up to silence the max listeners EventEmitter warning.
|
|
144
|
-
haste.setMaxListeners(1000);
|
|
145
|
-
|
|
146
|
-
return haste;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
82
|
static async load(
|
|
150
83
|
config: ConfigT,
|
|
151
84
|
options?: {|+hasReducedPerformance?: boolean, +watch?: boolean|},
|
|
152
85
|
): Promise<DependencyGraph> {
|
|
86
|
+
const {hasReducedPerformance, watch} = options ?? {};
|
|
153
87
|
const initializingMetroLogEntry = log(
|
|
154
88
|
createActionStartEntry('Initializing Metro'),
|
|
155
89
|
);
|
|
156
90
|
|
|
157
91
|
config.reporter.update({
|
|
158
92
|
type: 'dep_graph_loading',
|
|
159
|
-
hasReducedPerformance:
|
|
160
|
-
? Boolean(options.hasReducedPerformance)
|
|
161
|
-
: false,
|
|
93
|
+
hasReducedPerformance: !!hasReducedPerformance,
|
|
162
94
|
});
|
|
163
|
-
const haste =
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
95
|
+
const haste = createHasteMap(config, {watch});
|
|
96
|
+
|
|
97
|
+
// We can have a lot of graphs listening to Haste for changes.
|
|
98
|
+
// Bump this up to silence the max listeners EventEmitter warning.
|
|
99
|
+
haste.setMaxListeners(1000);
|
|
100
|
+
|
|
167
101
|
const {hasteFS, moduleMap} = await haste.build();
|
|
168
102
|
|
|
169
103
|
log(createActionEndEntry(initializingMetroLogEntry));
|
|
@@ -210,7 +144,10 @@ class DependencyGraph extends EventEmitter {
|
|
|
210
144
|
} catch (e) {}
|
|
211
145
|
return false;
|
|
212
146
|
},
|
|
147
|
+
disableHierarchicalLookup:
|
|
148
|
+
this._config.resolver.disableHierarchicalLookup,
|
|
213
149
|
doesFileExist: this._doesFileExist,
|
|
150
|
+
emptyModulePath: this._config.resolver.emptyModulePath,
|
|
214
151
|
extraNodeModules: this._config.resolver.extraNodeModules,
|
|
215
152
|
isAssetFile: file => this._assetExtensions.has(path.extname(file)),
|
|
216
153
|
mainFields: this._config.resolver.resolverMainFields,
|
|
@@ -272,8 +209,7 @@ class DependencyGraph extends EventEmitter {
|
|
|
272
209
|
return sha1;
|
|
273
210
|
}
|
|
274
211
|
|
|
275
|
-
|
|
276
|
-
getWatcher(): JestHasteMap {
|
|
212
|
+
getWatcher(): EventEmitter {
|
|
277
213
|
return this._haste;
|
|
278
214
|
}
|
|
279
215
|
|
|
@@ -289,20 +225,21 @@ class DependencyGraph extends EventEmitter {
|
|
|
289
225
|
assumeFlatNodeModules: false,
|
|
290
226
|
},
|
|
291
227
|
): string {
|
|
292
|
-
const
|
|
228
|
+
const isSensitiveToOriginFolder =
|
|
229
|
+
// Resolution is always relative to the origin folder unless we assume a flat node_modules
|
|
230
|
+
!assumeFlatNodeModules ||
|
|
231
|
+
// Path requests are resolved relative to the origin folder
|
|
293
232
|
to.includes('/') ||
|
|
294
233
|
to === '.' ||
|
|
295
234
|
to === '..' ||
|
|
235
|
+
// Preserve standard assumptions under node_modules
|
|
296
236
|
from.includes(path.sep + 'node_modules' + path.sep);
|
|
297
237
|
const mapByDirectory = getOrCreate(
|
|
298
238
|
this._resolutionCache,
|
|
299
|
-
|
|
239
|
+
isSensitiveToOriginFolder ? path.dirname(from) : '',
|
|
300
240
|
);
|
|
301
|
-
|
|
241
|
+
const mapByPlatform = getOrCreate(mapByDirectory, to);
|
|
302
242
|
let modulePath = mapByPlatform.get(platform);
|
|
303
|
-
if (!modulePath) {
|
|
304
|
-
modulePath = this._moduleMap.getModule(to, platform, true);
|
|
305
|
-
}
|
|
306
243
|
|
|
307
244
|
if (!modulePath) {
|
|
308
245
|
try {
|
|
@@ -312,18 +249,6 @@ class DependencyGraph extends EventEmitter {
|
|
|
312
249
|
true,
|
|
313
250
|
platform,
|
|
314
251
|
).path;
|
|
315
|
-
|
|
316
|
-
// If we cannot assume that only one node_modules folder exists in the project,
|
|
317
|
-
// we need to cache packages by directory instead of globally.
|
|
318
|
-
if (
|
|
319
|
-
!assumeFlatNodeModules &&
|
|
320
|
-
modulePath.includes(path.sep + 'node_modules' + path.sep)
|
|
321
|
-
) {
|
|
322
|
-
mapByPlatform = getOrCreate(
|
|
323
|
-
getOrCreate(this._resolutionCache, path.dirname(from)),
|
|
324
|
-
to,
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
252
|
} catch (error) {
|
|
328
253
|
if (error instanceof DuplicateHasteCandidatesError) {
|
|
329
254
|
throw new AmbiguousModuleResolutionError(from, error);
|
|
@@ -358,7 +283,7 @@ class DependencyGraph extends EventEmitter {
|
|
|
358
283
|
}
|
|
359
284
|
|
|
360
285
|
getDependencies(filePath: string): Array<string> {
|
|
361
|
-
return this._hasteFS.getDependencies(filePath);
|
|
286
|
+
return nullthrows(this._hasteFS.getDependencies(filePath));
|
|
362
287
|
}
|
|
363
288
|
}
|
|
364
289
|
|
package/src/node-haste/Module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
const isAbsolutePath = require('absolute-path');
|
|
14
|
-
|
|
15
13
|
import type ModuleCache from './ModuleCache';
|
|
16
14
|
import type Package from './Package';
|
|
17
15
|
|
|
16
|
+
const isAbsolutePath = require('absolute-path');
|
|
17
|
+
|
|
18
18
|
class Module {
|
|
19
19
|
path: string;
|
|
20
20
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -14,11 +14,14 @@ const Module = require("./Module");
|
|
|
14
14
|
const Package = require("./Package");
|
|
15
15
|
|
|
16
16
|
class ModuleCache {
|
|
17
|
+
// Cache for "closest package.json" queries by module path.
|
|
18
|
+
// The inverse of _packagePathByModulePath.
|
|
17
19
|
constructor(options) {
|
|
18
20
|
this._getClosestPackage = options.getClosestPackage;
|
|
19
21
|
this._moduleCache = Object.create(null);
|
|
20
22
|
this._packageCache = Object.create(null);
|
|
21
|
-
this.
|
|
23
|
+
this._packagePathByModulePath = Object.create(null);
|
|
24
|
+
this._modulePathsByPackagePath = Object.create(null);
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
getModule(filePath) {
|
|
@@ -32,7 +35,7 @@ class ModuleCache {
|
|
|
32
35
|
getPackage(filePath) {
|
|
33
36
|
if (!this._packageCache[filePath]) {
|
|
34
37
|
this._packageCache[filePath] = new Package({
|
|
35
|
-
file: filePath
|
|
38
|
+
file: filePath,
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
41
|
|
|
@@ -40,24 +43,32 @@ class ModuleCache {
|
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
getPackageForModule(module) {
|
|
43
|
-
|
|
46
|
+
return this.getPackageOf(module.path);
|
|
47
|
+
}
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
getPackageOf(modulePath) {
|
|
50
|
+
var _this$_modulePathsByP;
|
|
51
|
+
|
|
52
|
+
let packagePath = this._packagePathByModulePath[modulePath];
|
|
53
|
+
|
|
54
|
+
if (packagePath && this._packageCache[packagePath]) {
|
|
55
|
+
return this._packageCache[packagePath];
|
|
51
56
|
}
|
|
52
57
|
|
|
53
|
-
packagePath = this._getClosestPackage(
|
|
58
|
+
packagePath = this._getClosestPackage(modulePath);
|
|
54
59
|
|
|
55
60
|
if (!packagePath) {
|
|
56
61
|
return null;
|
|
57
62
|
}
|
|
58
63
|
|
|
59
|
-
this.
|
|
60
|
-
|
|
64
|
+
this._packagePathByModulePath[modulePath] = packagePath;
|
|
65
|
+
const modulePaths =
|
|
66
|
+
(_this$_modulePathsByP = this._modulePathsByPackagePath[packagePath]) !==
|
|
67
|
+
null && _this$_modulePathsByP !== void 0
|
|
68
|
+
? _this$_modulePathsByP
|
|
69
|
+
: new Set();
|
|
70
|
+
modulePaths.add(modulePath);
|
|
71
|
+
this._modulePathsByPackagePath[packagePath] = modulePaths;
|
|
61
72
|
return this.getPackage(packagePath);
|
|
62
73
|
}
|
|
63
74
|
|
|
@@ -73,6 +84,36 @@ class ModuleCache {
|
|
|
73
84
|
|
|
74
85
|
delete this._packageCache[filePath];
|
|
75
86
|
}
|
|
87
|
+
|
|
88
|
+
if (this._packagePathByModulePath[filePath]) {
|
|
89
|
+
// filePath is a module inside a package.
|
|
90
|
+
const packagePath = this._packagePathByModulePath[filePath];
|
|
91
|
+
delete this._packagePathByModulePath[filePath]; // This change doesn't invalidate any cached "closest package.json"
|
|
92
|
+
// queries for the package's other modules. Clean up only this module.
|
|
93
|
+
|
|
94
|
+
const modulePaths = this._modulePathsByPackagePath[packagePath];
|
|
95
|
+
|
|
96
|
+
if (modulePaths) {
|
|
97
|
+
modulePaths.delete(filePath);
|
|
98
|
+
|
|
99
|
+
if (modulePaths.size === 0) {
|
|
100
|
+
delete this._modulePathsByPackagePath[packagePath];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (this._modulePathsByPackagePath[filePath]) {
|
|
106
|
+
// filePath is a package. This change invalidates all cached "closest
|
|
107
|
+
// package.json" queries for modules inside this package.
|
|
108
|
+
const modulePaths = this._modulePathsByPackagePath[filePath];
|
|
109
|
+
|
|
110
|
+
for (const modulePath of modulePaths) {
|
|
111
|
+
delete this._packagePathByModulePath[modulePath];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
modulePaths.clear();
|
|
115
|
+
delete this._modulePathsByPackagePath[filePath];
|
|
116
|
+
}
|
|
76
117
|
}
|
|
77
118
|
}
|
|
78
119
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -27,13 +27,25 @@ class ModuleCache {
|
|
|
27
27
|
__proto__: null,
|
|
28
28
|
...
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
// Cache for "closest package.json" queries by module path.
|
|
31
|
+
_packagePathByModulePath: {
|
|
32
|
+
[filePath: string]: string,
|
|
33
|
+
__proto__: null,
|
|
34
|
+
...
|
|
35
|
+
};
|
|
36
|
+
// The inverse of _packagePathByModulePath.
|
|
37
|
+
_modulePathsByPackagePath: {
|
|
38
|
+
[filePath: string]: Set<string>,
|
|
39
|
+
__proto__: null,
|
|
40
|
+
...
|
|
41
|
+
};
|
|
31
42
|
|
|
32
43
|
constructor(options: {getClosestPackage: GetClosestPackageFn, ...}) {
|
|
33
44
|
this._getClosestPackage = options.getClosestPackage;
|
|
34
45
|
this._moduleCache = Object.create(null);
|
|
35
46
|
this._packageCache = Object.create(null);
|
|
36
|
-
this.
|
|
47
|
+
this._packagePathByModulePath = Object.create(null);
|
|
48
|
+
this._modulePathsByPackagePath = Object.create(null);
|
|
37
49
|
}
|
|
38
50
|
|
|
39
51
|
getModule(filePath: string): Module {
|
|
@@ -53,21 +65,26 @@ class ModuleCache {
|
|
|
53
65
|
}
|
|
54
66
|
|
|
55
67
|
getPackageForModule(module: Module): ?Package {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
return this.getPackageOf(module.path);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
getPackageOf(modulePath: string): ?Package {
|
|
72
|
+
let packagePath = this._packagePathByModulePath[modulePath];
|
|
73
|
+
if (packagePath && this._packageCache[packagePath]) {
|
|
74
|
+
return this._packageCache[packagePath];
|
|
63
75
|
}
|
|
64
76
|
|
|
65
|
-
packagePath = this._getClosestPackage(
|
|
77
|
+
packagePath = this._getClosestPackage(modulePath);
|
|
66
78
|
if (!packagePath) {
|
|
67
79
|
return null;
|
|
68
80
|
}
|
|
69
81
|
|
|
70
|
-
this.
|
|
82
|
+
this._packagePathByModulePath[modulePath] = packagePath;
|
|
83
|
+
const modulePaths =
|
|
84
|
+
this._modulePathsByPackagePath[packagePath] ?? new Set();
|
|
85
|
+
modulePaths.add(modulePath);
|
|
86
|
+
this._modulePathsByPackagePath[packagePath] = modulePaths;
|
|
87
|
+
|
|
71
88
|
return this.getPackage(packagePath);
|
|
72
89
|
}
|
|
73
90
|
|
|
@@ -80,6 +97,30 @@ class ModuleCache {
|
|
|
80
97
|
this._packageCache[filePath].invalidate();
|
|
81
98
|
delete this._packageCache[filePath];
|
|
82
99
|
}
|
|
100
|
+
if (this._packagePathByModulePath[filePath]) {
|
|
101
|
+
// filePath is a module inside a package.
|
|
102
|
+
const packagePath = this._packagePathByModulePath[filePath];
|
|
103
|
+
delete this._packagePathByModulePath[filePath];
|
|
104
|
+
// This change doesn't invalidate any cached "closest package.json"
|
|
105
|
+
// queries for the package's other modules. Clean up only this module.
|
|
106
|
+
const modulePaths = this._modulePathsByPackagePath[packagePath];
|
|
107
|
+
if (modulePaths) {
|
|
108
|
+
modulePaths.delete(filePath);
|
|
109
|
+
if (modulePaths.size === 0) {
|
|
110
|
+
delete this._modulePathsByPackagePath[packagePath];
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (this._modulePathsByPackagePath[filePath]) {
|
|
115
|
+
// filePath is a package. This change invalidates all cached "closest
|
|
116
|
+
// package.json" queries for modules inside this package.
|
|
117
|
+
const modulePaths = this._modulePathsByPackagePath[filePath];
|
|
118
|
+
for (const modulePath of modulePaths) {
|
|
119
|
+
delete this._packagePathByModulePath[modulePath];
|
|
120
|
+
}
|
|
121
|
+
modulePaths.clear();
|
|
122
|
+
delete this._modulePathsByPackagePath[filePath];
|
|
123
|
+
}
|
|
83
124
|
}
|
|
84
125
|
}
|
|
85
126
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -42,21 +42,19 @@ class Package {
|
|
|
42
42
|
const replacements = getReplacements(json, mainFields);
|
|
43
43
|
|
|
44
44
|
if (replacements) {
|
|
45
|
-
const variants = [main];
|
|
45
|
+
const variants = [main];
|
|
46
46
|
|
|
47
47
|
if (main.slice(0, 2) === "./") {
|
|
48
|
-
// $FlowFixMe[incompatible-use]
|
|
49
48
|
variants.push(main.slice(2));
|
|
50
49
|
} else {
|
|
51
|
-
// $FlowFixMe[incompatible-type]
|
|
52
50
|
variants.push("./" + main);
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
for (const variant of variants) {
|
|
56
|
-
const winner =
|
|
57
|
-
replacements[variant] ||
|
|
58
|
-
replacements[variant + ".js"] ||
|
|
59
|
-
replacements[variant + ".json"] ||
|
|
54
|
+
const winner =
|
|
55
|
+
replacements[variant] ||
|
|
56
|
+
replacements[variant + ".js"] ||
|
|
57
|
+
replacements[variant + ".json"] ||
|
|
60
58
|
replacements[variant.replace(/(\.js|\.json)$/, "")];
|
|
61
59
|
|
|
62
60
|
if (winner) {
|
|
@@ -127,7 +125,7 @@ class Package {
|
|
|
127
125
|
|
|
128
126
|
function getReplacements(pkg, mainFields) {
|
|
129
127
|
const replacements = mainFields
|
|
130
|
-
.map(name => {
|
|
128
|
+
.map((name) => {
|
|
131
129
|
// If the field is a string, that doesn't mean we want to redirect the
|
|
132
130
|
// `main` file itself to anything else. See the spec.
|
|
133
131
|
if (!pkg[name] || typeof pkg[name] === "string") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -57,24 +57,17 @@ class Package {
|
|
|
57
57
|
const replacements = getReplacements(json, mainFields);
|
|
58
58
|
if (replacements) {
|
|
59
59
|
const variants = [main];
|
|
60
|
-
// $FlowFixMe[incompatible-use]
|
|
61
60
|
if (main.slice(0, 2) === './') {
|
|
62
|
-
// $FlowFixMe[incompatible-use]
|
|
63
61
|
variants.push(main.slice(2));
|
|
64
62
|
} else {
|
|
65
|
-
// $FlowFixMe[incompatible-type]
|
|
66
63
|
variants.push('./' + main);
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
for (const variant of variants) {
|
|
70
67
|
const winner =
|
|
71
|
-
// $FlowFixMe[incompatible-type]
|
|
72
68
|
replacements[variant] ||
|
|
73
|
-
// $FlowFixMe[incompatible-type]
|
|
74
69
|
replacements[variant + '.js'] ||
|
|
75
|
-
// $FlowFixMe[incompatible-type]
|
|
76
70
|
replacements[variant + '.json'] ||
|
|
77
|
-
// $FlowFixMe[incompatible-use]
|
|
78
71
|
replacements[variant.replace(/(\.js|\.json)$/, '')];
|
|
79
72
|
|
|
80
73
|
if (winner) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -30,14 +30,14 @@ function parseBaseName(baseName) {
|
|
|
30
30
|
if (!Number.isNaN(resolution)) {
|
|
31
31
|
return {
|
|
32
32
|
rootName,
|
|
33
|
-
resolution
|
|
33
|
+
resolution,
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
return {
|
|
39
39
|
rootName,
|
|
40
|
-
resolution: 1
|
|
40
|
+
resolution: 1,
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
@@ -59,7 +59,7 @@ function tryParse(filePath, platforms) {
|
|
|
59
59
|
name: rootName,
|
|
60
60
|
platform,
|
|
61
61
|
resolution,
|
|
62
|
-
type: extension
|
|
62
|
+
type: extension,
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -75,5 +75,5 @@ function parse(filePath, platforms) {
|
|
|
75
75
|
|
|
76
76
|
module.exports = {
|
|
77
77
|
parse,
|
|
78
|
-
tryParse
|
|
78
|
+
tryParse,
|
|
79
79
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -23,9 +23,7 @@ export type AssetPath = {|
|
|
|
23
23
|
|
|
24
24
|
const ASSET_BASE_NAME_RE = /(.+?)(@([\d.]+)x)?$/;
|
|
25
25
|
|
|
26
|
-
function parseBaseName(
|
|
27
|
-
baseName: string,
|
|
28
|
-
): {
|
|
26
|
+
function parseBaseName(baseName: string): {
|
|
29
27
|
resolution: number,
|
|
30
28
|
rootName: string,
|
|
31
29
|
...
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -27,7 +27,7 @@ function parsePlatformFilePath(filePath, platforms) {
|
|
|
27
27
|
dirPath,
|
|
28
28
|
baseName: fileName,
|
|
29
29
|
platform: null,
|
|
30
|
-
extension: null
|
|
30
|
+
extension: null,
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -39,7 +39,7 @@ function parsePlatformFilePath(filePath, platforms) {
|
|
|
39
39
|
dirPath,
|
|
40
40
|
baseName: match[1],
|
|
41
41
|
platform,
|
|
42
|
-
extension
|
|
42
|
+
extension,
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -48,7 +48,7 @@ function parsePlatformFilePath(filePath, platforms) {
|
|
|
48
48
|
dirPath,
|
|
49
49
|
baseName,
|
|
50
50
|
platform: null,
|
|
51
|
-
extension
|
|
51
|
+
extension,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
|