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
|
@@ -11,28 +11,32 @@ var transformHelpers = _interopRequireWildcard(require("./transformHelpers"));
|
|
|
11
11
|
var defaults = _interopRequireWildcard(
|
|
12
12
|
require("metro-config/private/defaults/defaults"),
|
|
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
|
function _interopRequireDefault(e) {
|
|
38
42
|
return e && e.__esModule ? e : { default: e };
|
|
@@ -76,6 +80,8 @@ async function getPrependedScripts(
|
|
|
76
80
|
lazy: false,
|
|
77
81
|
unstable_enablePackageExports:
|
|
78
82
|
config.resolver.unstable_enablePackageExports,
|
|
83
|
+
unstable_incrementalResolution:
|
|
84
|
+
config.resolver.unstable_incrementalResolution,
|
|
79
85
|
shallow: false,
|
|
80
86
|
},
|
|
81
87
|
);
|
|
@@ -84,15 +90,23 @@ async function getPrependedScripts(
|
|
|
84
90
|
dev: options.dev,
|
|
85
91
|
globalPrefix: config.transformer.globalPrefix,
|
|
86
92
|
requireCycleIgnorePatterns: config.resolver.requireCycleIgnorePatterns,
|
|
93
|
+
unstable_forceFullRefreshPatterns:
|
|
94
|
+
config.resolver.unstable_forceFullRefreshPatterns,
|
|
87
95
|
}),
|
|
88
96
|
...dependencies.values(),
|
|
89
97
|
];
|
|
90
98
|
}
|
|
91
|
-
function _getPrelude({
|
|
99
|
+
function _getPrelude({
|
|
100
|
+
dev,
|
|
101
|
+
globalPrefix,
|
|
102
|
+
requireCycleIgnorePatterns,
|
|
103
|
+
unstable_forceFullRefreshPatterns,
|
|
104
|
+
}) {
|
|
92
105
|
const code = (0, _getPreludeCode.default)({
|
|
93
106
|
isDev: dev,
|
|
94
107
|
globalPrefix,
|
|
95
108
|
requireCycleIgnorePatterns,
|
|
109
|
+
unstable_forceFullRefreshPatterns,
|
|
96
110
|
});
|
|
97
111
|
const name = "__prelude__";
|
|
98
112
|
return {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import type Bundler from '../Bundler';
|
|
13
|
-
import type
|
|
13
|
+
import type {Module, default as DeltaBundler} from '../DeltaBundler';
|
|
14
14
|
import type {TransformInputOptions} from '../DeltaBundler/types';
|
|
15
15
|
import type {ResolverInputOptions} from '../shared/types';
|
|
16
16
|
import type {ConfigT} from 'metro-config';
|
|
@@ -27,7 +27,7 @@ export default async function getPrependedScripts(
|
|
|
27
27
|
resolverOptions: ResolverInputOptions,
|
|
28
28
|
bundler: Bundler,
|
|
29
29
|
deltaBundler: DeltaBundler<>,
|
|
30
|
-
): Promise
|
|
30
|
+
): Promise<ReadonlyArray<Module<>>> {
|
|
31
31
|
// Get all the polyfills from the relevant option params (the
|
|
32
32
|
// `getPolyfills()` method and the `polyfillModuleNames` variable).
|
|
33
33
|
const polyfillModuleNames = config.serializer
|
|
@@ -64,6 +64,8 @@ export default async function getPrependedScripts(
|
|
|
64
64
|
lazy: false,
|
|
65
65
|
unstable_enablePackageExports:
|
|
66
66
|
config.resolver.unstable_enablePackageExports,
|
|
67
|
+
unstable_incrementalResolution:
|
|
68
|
+
config.resolver.unstable_incrementalResolution,
|
|
67
69
|
shallow: false,
|
|
68
70
|
},
|
|
69
71
|
);
|
|
@@ -73,6 +75,8 @@ export default async function getPrependedScripts(
|
|
|
73
75
|
dev: options.dev,
|
|
74
76
|
globalPrefix: config.transformer.globalPrefix,
|
|
75
77
|
requireCycleIgnorePatterns: config.resolver.requireCycleIgnorePatterns,
|
|
78
|
+
unstable_forceFullRefreshPatterns:
|
|
79
|
+
config.resolver.unstable_forceFullRefreshPatterns,
|
|
76
80
|
}),
|
|
77
81
|
...dependencies.values(),
|
|
78
82
|
];
|
|
@@ -82,16 +86,19 @@ function _getPrelude({
|
|
|
82
86
|
dev,
|
|
83
87
|
globalPrefix,
|
|
84
88
|
requireCycleIgnorePatterns,
|
|
89
|
+
unstable_forceFullRefreshPatterns,
|
|
85
90
|
}: {
|
|
86
91
|
dev: boolean,
|
|
87
92
|
globalPrefix: string,
|
|
88
|
-
requireCycleIgnorePatterns:
|
|
93
|
+
requireCycleIgnorePatterns: ReadonlyArray<RegExp>,
|
|
94
|
+
unstable_forceFullRefreshPatterns: ReadonlyArray<RegExp>,
|
|
89
95
|
...
|
|
90
96
|
}): Module<> {
|
|
91
97
|
const code = getPreludeCode({
|
|
92
98
|
isDev: dev,
|
|
93
99
|
globalPrefix,
|
|
94
100
|
requireCycleIgnorePatterns,
|
|
101
|
+
unstable_forceFullRefreshPatterns,
|
|
95
102
|
});
|
|
96
103
|
const name = '__prelude__';
|
|
97
104
|
|
|
@@ -0,0 +1,15 @@
|
|
|
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 {Dependency, ResolvedDependency} from '../DeltaBundler/types';
|
|
12
|
+
|
|
13
|
+
export declare function isResolvedDependency(
|
|
14
|
+
dep: Dependency,
|
|
15
|
+
): dep is ResolvedDependency;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type {Terminal} from 'metro-core';
|
|
11
|
+
|
|
12
|
+
declare const $$EXPORT_DEFAULT_DECLARATION$$: (
|
|
13
|
+
terminal: Terminal,
|
|
14
|
+
level: string,
|
|
15
|
+
...data: Array<unknown>
|
|
16
|
+
) => void;
|
|
17
|
+
declare type $$EXPORT_DEFAULT_DECLARATION$$ =
|
|
18
|
+
typeof $$EXPORT_DEFAULT_DECLARATION$$;
|
|
19
|
+
export default $$EXPORT_DEFAULT_DECLARATION$$;
|
|
@@ -4,8 +4,8 @@
|
|
|
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.
|
|
6
6
|
*
|
|
7
|
-
* @format
|
|
8
7
|
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/* eslint-disable no-console */
|
|
@@ -18,7 +18,7 @@ import util from 'util';
|
|
|
18
18
|
const groupStack = [];
|
|
19
19
|
let collapsedGuardTimer;
|
|
20
20
|
|
|
21
|
-
export default (terminal: Terminal, level: string, ...data: Array<
|
|
21
|
+
export default (terminal: Terminal, level: string, ...data: Array<unknown>) => {
|
|
22
22
|
// $FlowFixMe[invalid-computed-prop]
|
|
23
23
|
const logFunction = console[level] && level !== 'trace' ? level : 'log';
|
|
24
24
|
const color =
|
|
@@ -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 {BundleOptions} from '../shared/types';
|
|
12
|
+
|
|
13
|
+
declare function parseBundleOptionsFromBundleRequestUrl(
|
|
14
|
+
rawNonJscSafeUrlEncodedUrl: string,
|
|
15
|
+
platforms: Set<string>,
|
|
16
|
+
): Omit<BundleOptions, keyof {bundleType: string}> & {bundleType: string};
|
|
17
|
+
export default parseBundleOptionsFromBundleRequestUrl;
|
|
@@ -16,28 +16,32 @@ var _parseCustomTransformOptions = _interopRequireDefault(
|
|
|
16
16
|
);
|
|
17
17
|
var jscSafeUrl = _interopRequireWildcard(require("jsc-safe-url"));
|
|
18
18
|
var _path = _interopRequireDefault(require("path"));
|
|
19
|
-
function
|
|
20
|
-
if ("function"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var n = { __proto__: null },
|
|
34
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
35
|
-
for (var u in e)
|
|
36
|
-
if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
37
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
38
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : (n[u] = e[u]);
|
|
19
|
+
function _interopRequireWildcard(e, t) {
|
|
20
|
+
if ("function" == typeof WeakMap)
|
|
21
|
+
var r = new WeakMap(),
|
|
22
|
+
n = new WeakMap();
|
|
23
|
+
return (_interopRequireWildcard = function (e, t) {
|
|
24
|
+
if (!t && e && e.__esModule) return e;
|
|
25
|
+
var o,
|
|
26
|
+
i,
|
|
27
|
+
f = { __proto__: null, default: e };
|
|
28
|
+
if (null === e || ("object" != typeof e && "function" != typeof e))
|
|
29
|
+
return f;
|
|
30
|
+
if ((o = t ? n : r)) {
|
|
31
|
+
if (o.has(e)) return o.get(e);
|
|
32
|
+
o.set(e, f);
|
|
39
33
|
}
|
|
40
|
-
|
|
34
|
+
for (const t in e)
|
|
35
|
+
"default" !== t &&
|
|
36
|
+
{}.hasOwnProperty.call(e, t) &&
|
|
37
|
+
((i =
|
|
38
|
+
(o = Object.defineProperty) &&
|
|
39
|
+
Object.getOwnPropertyDescriptor(e, t)) &&
|
|
40
|
+
(i.get || i.set)
|
|
41
|
+
? o(f, t, i)
|
|
42
|
+
: (f[t] = e[t]));
|
|
43
|
+
return f;
|
|
44
|
+
})(e, t);
|
|
41
45
|
}
|
|
42
46
|
function _interopRequireDefault(e) {
|
|
43
47
|
return e && e.__esModule ? e : { default: e };
|
|
@@ -0,0 +1,16 @@
|
|
|
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 {CustomResolverOptions} from 'metro-resolver';
|
|
12
|
+
|
|
13
|
+
declare function parseCustomResolverOptions(
|
|
14
|
+
searchParams: URLSearchParams,
|
|
15
|
+
): CustomResolverOptions;
|
|
16
|
+
export default parseCustomResolverOptions;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @oncall react_native
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import type {CustomResolverOptions} from '
|
|
12
|
+
import type {CustomResolverOptions} from 'metro-resolver';
|
|
13
13
|
|
|
14
14
|
const PREFIX = 'resolver.';
|
|
15
15
|
|
|
@@ -18,7 +18,7 @@ export default function parseCustomResolverOptions(
|
|
|
18
18
|
): CustomResolverOptions {
|
|
19
19
|
const customResolverOptions: {
|
|
20
20
|
__proto__: null,
|
|
21
|
-
[string]:
|
|
21
|
+
[string]: unknown,
|
|
22
22
|
...
|
|
23
23
|
} = Object.create(null);
|
|
24
24
|
|
|
@@ -0,0 +1,16 @@
|
|
|
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 {CustomTransformOptions} from 'metro-transform-worker';
|
|
12
|
+
|
|
13
|
+
declare function parseCustomTransformOptions(
|
|
14
|
+
searchParams: URLSearchParams,
|
|
15
|
+
): CustomTransformOptions;
|
|
16
|
+
export default parseCustomTransformOptions;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 {IncomingMessage} from 'http';
|
|
12
|
+
|
|
13
|
+
export type JsonData =
|
|
14
|
+
| {[$$Key$$: string]: JsonData}
|
|
15
|
+
| Array<JsonData>
|
|
16
|
+
| string
|
|
17
|
+
| number
|
|
18
|
+
| boolean
|
|
19
|
+
| null;
|
|
20
|
+
/**
|
|
21
|
+
* Attempt to parse a request body as JSON.
|
|
22
|
+
*/
|
|
23
|
+
declare function parseJsonBody(
|
|
24
|
+
req: IncomingMessage,
|
|
25
|
+
options?: {strict?: boolean},
|
|
26
|
+
): Promise<JsonData>;
|
|
27
|
+
export default parseJsonBody;
|
|
@@ -14,13 +14,23 @@ import type {IncomingMessage} from 'http';
|
|
|
14
14
|
const CONTENT_TYPE = 'application/json';
|
|
15
15
|
const SIZE_LIMIT = 100 * 1024 * 1024; // 100MB
|
|
16
16
|
|
|
17
|
+
export type JsonData =
|
|
18
|
+
| {
|
|
19
|
+
[string]: JsonData,
|
|
20
|
+
}
|
|
21
|
+
| Array<JsonData>
|
|
22
|
+
| string
|
|
23
|
+
| number
|
|
24
|
+
| boolean
|
|
25
|
+
| null;
|
|
26
|
+
|
|
17
27
|
/**
|
|
18
28
|
* Attempt to parse a request body as JSON.
|
|
19
29
|
*/
|
|
20
30
|
export default function parseJsonBody(
|
|
21
31
|
req: IncomingMessage,
|
|
22
32
|
options: {strict?: boolean} = {},
|
|
23
|
-
): Promise
|
|
33
|
+
): Promise<JsonData> {
|
|
24
34
|
const {strict = true} = options;
|
|
25
35
|
|
|
26
36
|
return new Promise((resolve, reject) => {
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
*/
|
|
9
|
+
|
|
10
|
+
export declare const normalizePathSeparatorsToPosix: (
|
|
11
|
+
$$PARAM_0$$: string,
|
|
12
|
+
) => string;
|
|
13
|
+
export declare type normalizePathSeparatorsToPosix =
|
|
14
|
+
typeof normalizePathSeparatorsToPosix;
|
package/src/lib/pathUtils.js
CHANGED
|
@@ -5,28 +5,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.normalizePathSeparatorsToPosix = void 0;
|
|
7
7
|
var path = _interopRequireWildcard(require("path"));
|
|
8
|
-
function
|
|
9
|
-
if ("function"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var n = { __proto__: null },
|
|
23
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
24
|
-
for (var u in e)
|
|
25
|
-
if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
26
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
27
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : (n[u] = e[u]);
|
|
8
|
+
function _interopRequireWildcard(e, t) {
|
|
9
|
+
if ("function" == typeof WeakMap)
|
|
10
|
+
var r = new WeakMap(),
|
|
11
|
+
n = new WeakMap();
|
|
12
|
+
return (_interopRequireWildcard = function (e, t) {
|
|
13
|
+
if (!t && e && e.__esModule) return e;
|
|
14
|
+
var o,
|
|
15
|
+
i,
|
|
16
|
+
f = { __proto__: null, default: e };
|
|
17
|
+
if (null === e || ("object" != typeof e && "function" != typeof e))
|
|
18
|
+
return f;
|
|
19
|
+
if ((o = t ? n : r)) {
|
|
20
|
+
if (o.has(e)) return o.get(e);
|
|
21
|
+
o.set(e, f);
|
|
28
22
|
}
|
|
29
|
-
|
|
23
|
+
for (const t in e)
|
|
24
|
+
"default" !== t &&
|
|
25
|
+
{}.hasOwnProperty.call(e, t) &&
|
|
26
|
+
((i =
|
|
27
|
+
(o = Object.defineProperty) &&
|
|
28
|
+
Object.getOwnPropertyDescriptor(e, t)) &&
|
|
29
|
+
(i.get || i.set)
|
|
30
|
+
? o(f, t, i)
|
|
31
|
+
: (f[t] = e[t]));
|
|
32
|
+
return f;
|
|
33
|
+
})(e, t);
|
|
30
34
|
}
|
|
31
35
|
const normalizePathSeparatorsToPosix = (exports.normalizePathSeparatorsToPosix =
|
|
32
36
|
path.sep === "/"
|
|
@@ -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 {MixedSourceMap} from 'metro-source-map';
|
|
12
|
+
|
|
13
|
+
declare function relativizeSourceMapInline(
|
|
14
|
+
sourceMap: MixedSourceMap,
|
|
15
|
+
sourcesRoot: string,
|
|
16
|
+
): void;
|
|
17
|
+
export default relativizeSourceMapInline;
|