metro 0.83.5 → 0.83.6
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 +15 -15
- package/src/Assets.d.ts +8 -1
- package/src/Bundler/util.d.ts +8 -1
- package/src/Bundler/util.js.flow +3 -3
- package/src/Bundler.d.ts +8 -1
- package/src/DeltaBundler/DeltaCalculator.d.ts +8 -11
- package/src/DeltaBundler/DeltaCalculator.js +55 -46
- package/src/DeltaBundler/DeltaCalculator.js.flow +72 -61
- package/src/DeltaBundler/Graph.d.ts +8 -1
- package/src/DeltaBundler/Serializers/baseJSBundle.d.ts +8 -1
- package/src/DeltaBundler/Serializers/getAllFiles.d.ts +8 -1
- package/src/DeltaBundler/Serializers/getAssets.d.ts +8 -1
- package/src/DeltaBundler/Serializers/getExplodedSourceMap.d.ts +8 -1
- package/src/DeltaBundler/Serializers/getRamBundleInfo.d.ts +8 -1
- package/src/DeltaBundler/Serializers/helpers/getInlineSourceMappingURL.d.ts +8 -1
- package/src/DeltaBundler/Serializers/helpers/getSourceMapInfo.d.ts +8 -1
- package/src/DeltaBundler/Serializers/helpers/getTransitiveDependencies.d.ts +8 -1
- package/src/DeltaBundler/Serializers/helpers/js.d.ts +8 -1
- package/src/DeltaBundler/Serializers/helpers/processModules.d.ts +8 -1
- package/src/DeltaBundler/Serializers/hmrJSBundle.d.ts +8 -1
- package/src/DeltaBundler/Serializers/sourceMapGenerator.d.ts +8 -1
- package/src/DeltaBundler/Serializers/sourceMapObject.d.ts +8 -1
- package/src/DeltaBundler/Serializers/sourceMapString.d.ts +8 -1
- package/src/DeltaBundler/Transformer.d.ts +8 -1
- package/src/DeltaBundler/Worker.d.ts +8 -1
- package/src/DeltaBundler/WorkerFarm.d.ts +8 -1
- package/src/DeltaBundler/buildSubgraph.d.ts +8 -1
- package/src/DeltaBundler/getTransformCacheKey.d.ts +8 -1
- package/src/DeltaBundler/getTransformCacheKey.js +3 -1
- package/src/DeltaBundler/getTransformCacheKey.js.flow +7 -2
- package/src/DeltaBundler/mergeDeltas.d.ts +8 -1
- package/src/DeltaBundler/types.d.ts +8 -1
- package/src/DeltaBundler.d.ts +8 -1
- package/src/HmrServer.d.ts +22 -3
- package/src/HmrServer.js +7 -0
- package/src/HmrServer.js.flow +15 -5
- package/src/IncrementalBundler/GraphNotFoundError.d.ts +8 -1
- package/src/IncrementalBundler/ResourceNotFoundError.d.ts +8 -1
- package/src/IncrementalBundler/RevisionNotFoundError.d.ts +8 -1
- package/src/IncrementalBundler.d.ts +8 -1
- package/src/ModuleGraph/worker/JsFileWrapping.d.ts +8 -1
- package/src/ModuleGraph/worker/collectDependencies.d.ts +8 -1
- package/src/ModuleGraph/worker/generateImportNames.d.ts +8 -1
- package/src/ModuleGraph/worker/importLocationsPlugin.d.ts +8 -1
- package/src/Server/MultipartResponse.d.ts +8 -1
- package/src/Server/symbolicate.d.ts +8 -1
- package/src/Server.d.ts +8 -1
- package/src/cli/parseKeyValueParamArray.d.ts +8 -1
- package/src/cli-utils.d.ts +8 -1
- package/src/commands/build.d.ts +8 -1
- package/src/commands/dependencies.d.ts +8 -1
- package/src/commands/serve.d.ts +8 -1
- package/src/index.d.ts +29 -3
- package/src/index.flow.js.flow +21 -2
- package/src/lib/BatchProcessor.d.ts +8 -1
- package/src/lib/CountingSet.d.ts +8 -1
- package/src/lib/JsonReporter.d.ts +8 -1
- package/src/lib/JsonReporter.js.flow +2 -2
- package/src/lib/RamBundleParser.d.ts +8 -1
- package/src/lib/TerminalReporter.d.ts +8 -1
- package/src/lib/bundleProgressUtils.d.ts +8 -1
- package/src/lib/bundleToString.d.ts +8 -1
- package/src/lib/contextModule.d.ts +8 -1
- package/src/lib/contextModuleTemplates.d.ts +8 -1
- package/src/lib/countLines.d.ts +8 -1
- package/src/lib/createWebsocketServer.d.ts +8 -1
- package/src/lib/debounceAsyncQueue.d.ts +8 -1
- package/src/lib/formatBundlingError.d.ts +8 -1
- package/src/lib/getAppendScripts.d.ts +8 -1
- package/src/lib/getAppendScripts.js.flow +2 -2
- package/src/lib/getGraphId.d.ts +8 -1
- package/src/lib/getPreludeCode.d.ts +8 -1
- package/src/lib/getPrependedScripts.d.ts +8 -1
- package/src/lib/isResolvedDependency.d.ts +8 -1
- package/src/lib/logToConsole.d.ts +8 -1
- package/src/lib/parseBundleOptionsFromBundleRequestUrl.d.ts +8 -1
- package/src/lib/parseCustomResolverOptions.d.ts +8 -1
- package/src/lib/parseCustomTransformOptions.d.ts +8 -1
- package/src/lib/parseJsonBody.d.ts +8 -1
- package/src/lib/pathUtils.d.ts +8 -1
- package/src/lib/relativizeSourceMap.d.ts +8 -1
- package/src/lib/reporting.d.ts +8 -1
- package/src/lib/splitBundleOptions.d.ts +8 -1
- package/src/lib/transformHelpers.d.ts +8 -1
- package/src/node-haste/DependencyGraph/ModuleResolution.d.ts +16 -22
- package/src/node-haste/DependencyGraph/ModuleResolution.js +4 -22
- package/src/node-haste/DependencyGraph/ModuleResolution.js.flow +10 -59
- package/src/node-haste/DependencyGraph/createFileMap.d.ts +8 -1
- package/src/node-haste/DependencyGraph/createFileMap.js +1 -1
- package/src/node-haste/DependencyGraph/createFileMap.js.flow +4 -2
- package/src/node-haste/DependencyGraph.d.ts +9 -5
- package/src/node-haste/DependencyGraph.js +22 -11
- package/src/node-haste/DependencyGraph.js.flow +24 -13
- package/src/node-haste/PackageCache.d.ts +19 -16
- package/src/node-haste/PackageCache.js +65 -54
- package/src/node-haste/PackageCache.js.flow +103 -79
- package/src/node-haste/lib/AssetPaths.d.ts +8 -1
- package/src/node-haste/lib/parsePlatformFilePath.d.ts +8 -1
- package/src/shared/output/RamBundle/as-assets.d.ts +8 -1
- package/src/shared/output/RamBundle/as-indexed-file.d.ts +8 -1
- package/src/shared/output/RamBundle/buildSourcemapWithMetadata.d.ts +8 -1
- package/src/shared/output/RamBundle/magic-number.d.ts +8 -1
- package/src/shared/output/RamBundle/util.d.ts +8 -1
- package/src/shared/output/RamBundle/write-sourcemap.d.ts +8 -1
- package/src/shared/output/RamBundle.d.ts +8 -1
- package/src/shared/output/bundle.d.ts +8 -1
- package/src/shared/output/meta.d.ts +8 -1
- package/src/shared/output/unbundle.d.ts +8 -1
- package/src/shared/output/writeFile.d.ts +8 -1
- package/src/shared/types.d.ts +8 -1
- package/src/node-haste/Package.d.ts +0 -21
- package/src/node-haste/Package.js +0 -28
- package/src/node-haste/Package.js.flow +0 -39
|
@@ -9,117 +9,141 @@
|
|
|
9
9
|
* @oncall react_native
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import
|
|
12
|
+
import type {PackageJson} from 'metro-resolver/private/types';
|
|
13
|
+
|
|
14
|
+
import {readFileSync} from 'fs';
|
|
15
|
+
import {dirname, sep} from 'path';
|
|
13
16
|
|
|
14
17
|
type GetClosestPackageFn = (absoluteFilePath: string) => ?{
|
|
15
18
|
packageJsonPath: string,
|
|
16
19
|
packageRelativePath: string,
|
|
17
20
|
};
|
|
18
21
|
|
|
22
|
+
type PackageForModule = Readonly<{
|
|
23
|
+
packageJson: PackageJson,
|
|
24
|
+
rootPath: string,
|
|
25
|
+
packageRelativePath: string,
|
|
26
|
+
}>;
|
|
27
|
+
|
|
19
28
|
export class PackageCache {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// Cache for "closest package.json" queries by module path.
|
|
27
|
-
_packagePathAndSubpathByModulePath: {
|
|
28
|
-
[filePath: string]: ?{
|
|
29
|
-
packageJsonPath: string,
|
|
30
|
-
packageRelativePath: string,
|
|
29
|
+
#getClosestPackage: GetClosestPackageFn;
|
|
30
|
+
#packageCache: Map<
|
|
31
|
+
string,
|
|
32
|
+
{
|
|
33
|
+
rootPath: string,
|
|
34
|
+
packageJson: PackageJson,
|
|
31
35
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
...
|
|
40
|
-
};
|
|
36
|
+
>;
|
|
37
|
+
// Single cache: module path → pre-built result object, or null (no allocation on hit)
|
|
38
|
+
#resultByModulePath: Map<string, PackageForModule | null>;
|
|
39
|
+
// Reverse index for invalidation: package.json path → set of module paths
|
|
40
|
+
#modulePathsByPackagePath: Map<string, Set<string>>;
|
|
41
|
+
// Module paths that resolved to no package.json (null), for invalidation
|
|
42
|
+
#modulePathsWithNoPackage: Set<string>;
|
|
41
43
|
|
|
42
44
|
constructor(options: {getClosestPackage: GetClosestPackageFn, ...}) {
|
|
43
|
-
this
|
|
44
|
-
this
|
|
45
|
-
this
|
|
46
|
-
this
|
|
45
|
+
this.#getClosestPackage = options.getClosestPackage;
|
|
46
|
+
this.#packageCache = new Map();
|
|
47
|
+
this.#resultByModulePath = new Map();
|
|
48
|
+
this.#modulePathsByPackagePath = new Map();
|
|
49
|
+
this.#modulePathsWithNoPackage = new Set();
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
getPackage(filePath: string):
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
getPackage(filePath: string): Readonly<{
|
|
53
|
+
rootPath: string,
|
|
54
|
+
packageJson: PackageJson,
|
|
55
|
+
}> {
|
|
56
|
+
let cached = this.#packageCache.get(filePath);
|
|
57
|
+
if (cached == null) {
|
|
58
|
+
cached = {
|
|
59
|
+
rootPath: dirname(filePath),
|
|
60
|
+
packageJson: JSON.parse(readFileSync(filePath, 'utf8')),
|
|
61
|
+
};
|
|
62
|
+
this.#packageCache.set(filePath, cached);
|
|
54
63
|
}
|
|
55
|
-
return
|
|
64
|
+
return cached;
|
|
56
65
|
}
|
|
57
66
|
|
|
58
|
-
|
|
59
|
-
absoluteModulePath
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
) {
|
|
67
|
-
return {
|
|
68
|
-
pkg: this._packageCache[packagePathAndSubpath.packageJsonPath],
|
|
69
|
-
packageRelativePath: packagePathAndSubpath.packageRelativePath,
|
|
70
|
-
};
|
|
67
|
+
getPackageForModule(absoluteModulePath: string): ?PackageForModule {
|
|
68
|
+
const cached = this.#resultByModulePath.get(absoluteModulePath);
|
|
69
|
+
|
|
70
|
+
// Distinguish between `null` (positively no closest package) and
|
|
71
|
+
// `undefined` (no cached result yet)
|
|
72
|
+
// eslint-disable-next-line lint/strictly-null
|
|
73
|
+
if (cached !== undefined) {
|
|
74
|
+
return cached;
|
|
71
75
|
}
|
|
72
76
|
|
|
73
|
-
|
|
74
|
-
if (
|
|
77
|
+
const closest = this.#getClosestPackage(absoluteModulePath);
|
|
78
|
+
if (closest == null) {
|
|
79
|
+
this.#resultByModulePath.set(absoluteModulePath, null);
|
|
80
|
+
this.#modulePathsWithNoPackage.add(absoluteModulePath);
|
|
75
81
|
return null;
|
|
76
82
|
}
|
|
77
83
|
|
|
78
|
-
const packagePath =
|
|
84
|
+
const packagePath = closest.packageJsonPath;
|
|
79
85
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
// Track module→package for invalidation
|
|
87
|
+
let modulePaths = this.#modulePathsByPackagePath.get(packagePath);
|
|
88
|
+
if (modulePaths == null) {
|
|
89
|
+
modulePaths = new Set();
|
|
90
|
+
this.#modulePathsByPackagePath.set(packagePath, modulePaths);
|
|
91
|
+
}
|
|
84
92
|
modulePaths.add(absoluteModulePath);
|
|
85
|
-
this._modulePathsByPackagePath[packagePath] = modulePaths;
|
|
86
93
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
const pkg = this.getPackage(packagePath);
|
|
95
|
+
if (pkg == null) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Cache the pre-built result object — no allocation on future hits
|
|
100
|
+
const result: PackageForModule = {
|
|
101
|
+
packageJson: pkg.packageJson,
|
|
102
|
+
packageRelativePath: closest.packageRelativePath,
|
|
103
|
+
rootPath: pkg.rootPath,
|
|
90
104
|
};
|
|
105
|
+
this.#resultByModulePath.set(absoluteModulePath, result);
|
|
106
|
+
return result;
|
|
91
107
|
}
|
|
92
108
|
|
|
93
109
|
invalidate(filePath: string) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
delete this._modulePathsByPackagePath[packagePath];
|
|
110
|
+
this.#packageCache.delete(filePath);
|
|
111
|
+
|
|
112
|
+
// Clean up any cached result for this module path (including null).
|
|
113
|
+
// Derive the package.json path from the cached result to clean up the
|
|
114
|
+
// reverse index.
|
|
115
|
+
const cachedResult = this.#resultByModulePath.get(filePath);
|
|
116
|
+
this.#resultByModulePath.delete(filePath);
|
|
117
|
+
this.#modulePathsWithNoPackage.delete(filePath);
|
|
118
|
+
|
|
119
|
+
if (cachedResult != null) {
|
|
120
|
+
const packagePath = cachedResult.rootPath + sep + 'package.json';
|
|
121
|
+
const modules = this.#modulePathsByPackagePath.get(packagePath);
|
|
122
|
+
if (modules != null) {
|
|
123
|
+
modules.delete(filePath);
|
|
124
|
+
if (modules.size === 0) {
|
|
125
|
+
this.#modulePathsByPackagePath.delete(packagePath);
|
|
111
126
|
}
|
|
112
127
|
}
|
|
113
128
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
129
|
+
|
|
130
|
+
// If filePath is a package.json, invalidate all module lookups pointing to it
|
|
131
|
+
const modulePaths = this.#modulePathsByPackagePath.get(filePath);
|
|
132
|
+
if (modulePaths != null) {
|
|
118
133
|
for (const modulePath of modulePaths) {
|
|
119
|
-
|
|
134
|
+
this.#resultByModulePath.delete(modulePath);
|
|
135
|
+
}
|
|
136
|
+
this.#modulePathsByPackagePath.delete(filePath);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// If a package.json was created, modified, or deleted, invalidate all
|
|
140
|
+
// null-cached module results, since modules that previously had no
|
|
141
|
+
// enclosing package.json may now resolve to this one.
|
|
142
|
+
if (filePath.endsWith(sep + 'package.json')) {
|
|
143
|
+
for (const modulePath of this.#modulePathsWithNoPackage) {
|
|
144
|
+
this.#resultByModulePath.delete(modulePath);
|
|
120
145
|
}
|
|
121
|
-
|
|
122
|
-
delete this._modulePathsByPackagePath[filePath];
|
|
146
|
+
this.#modulePathsWithNoPackage.clear();
|
|
123
147
|
}
|
|
124
148
|
}
|
|
125
149
|
}
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<31b3384bffa191e4c3c9916d93df8571>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/node-haste/lib/AssetPaths.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
export type AssetPath = {
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<61c16b5ef31517dc44347558a4dd431a>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/node-haste/lib/parsePlatformFilePath.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
type PlatformFilePathParts = {
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<02d7f6eec9c93d02612c9b2fdef18cef>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/output/RamBundle/as-assets.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
import type {RamBundleInfo} from '../../../DeltaBundler/Serializers/getRamBundleInfo';
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<cf05d2127a356bae7e3789c2fefa25d3>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/output/RamBundle/as-indexed-file.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
import type {RamBundleInfo} from '../../../DeltaBundler/Serializers/getRamBundleInfo';
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<669a46ab2a802ea2b93d98edf337fff0>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/output/RamBundle/buildSourcemapWithMetadata.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
import type {ModuleGroups, ModuleTransportLike} from '../../types';
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<94cd41a2f04528e81f82e6c2feadaf52>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/output/RamBundle/magic-number.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
declare const $$EXPORT_DEFAULT_DECLARATION$$: 0xfb0bd1e5;
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<cb3371e2f23da9cd30e08ed76ec4f7db>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/output/RamBundle/util.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
import type {ModuleGroups, ModuleTransportLike} from '../../types';
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<000f29900c01342de92d247507075575>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/output/RamBundle/write-sourcemap.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
declare function writeSourcemap(
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<bef82861a3de459220bf62515fd5900c>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/output/RamBundle.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
import type {RamBundleInfo} from '../../DeltaBundler/Serializers/getRamBundleInfo';
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<d9877b2ba27e8e3f279901c80c7ad895>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/output/bundle.flow.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
import type {AssetData} from '../../Assets';
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<17ae3fc242dc6b3915a72d04dad032b8>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/output/meta.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
declare function meta(
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<12b27507f799c8170067738c227bb2f3>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/output/unbundle.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
export * from './RamBundle';
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<37de849e415f8aa1e94b73289a573ee3>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/output/writeFile.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
declare function writeFile(
|
package/src/shared/types.d.ts
CHANGED
|
@@ -4,8 +4,15 @@
|
|
|
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
|
-
* @
|
|
7
|
+
* @noformat
|
|
8
8
|
* @oncall react_native
|
|
9
|
+
* @generated SignedSource<<31593693c0cafcd55eaf4885efddc6be>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/shared/types.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
import type {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {PackageJson} from 'metro-resolver/private/types';
|
|
12
|
-
|
|
13
|
-
declare class Package {
|
|
14
|
-
path: string;
|
|
15
|
-
_root: string;
|
|
16
|
-
_content: null | undefined | PackageJson;
|
|
17
|
-
constructor($$PARAM_0$$: {file: string});
|
|
18
|
-
invalidate(): void;
|
|
19
|
-
read(): PackageJson;
|
|
20
|
-
}
|
|
21
|
-
export default Package;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true,
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _fs = _interopRequireDefault(require("fs"));
|
|
8
|
-
var _path = _interopRequireDefault(require("path"));
|
|
9
|
-
function _interopRequireDefault(e) {
|
|
10
|
-
return e && e.__esModule ? e : { default: e };
|
|
11
|
-
}
|
|
12
|
-
class Package {
|
|
13
|
-
constructor({ file }) {
|
|
14
|
-
this.path = _path.default.resolve(file);
|
|
15
|
-
this._root = _path.default.dirname(this.path);
|
|
16
|
-
this._content = null;
|
|
17
|
-
}
|
|
18
|
-
invalidate() {
|
|
19
|
-
this._content = null;
|
|
20
|
-
}
|
|
21
|
-
read() {
|
|
22
|
-
if (this._content == null) {
|
|
23
|
-
this._content = JSON.parse(_fs.default.readFileSync(this.path, "utf8"));
|
|
24
|
-
}
|
|
25
|
-
return this._content;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.default = Package;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict-local
|
|
8
|
-
* @format
|
|
9
|
-
* @oncall react_native
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import type {PackageJson} from 'metro-resolver/private/types';
|
|
13
|
-
|
|
14
|
-
import fs from 'fs';
|
|
15
|
-
import path from 'path';
|
|
16
|
-
|
|
17
|
-
export default class Package {
|
|
18
|
-
path: string;
|
|
19
|
-
|
|
20
|
-
_root: string;
|
|
21
|
-
_content: ?PackageJson;
|
|
22
|
-
|
|
23
|
-
constructor({file}: {file: string, ...}) {
|
|
24
|
-
this.path = path.resolve(file);
|
|
25
|
-
this._root = path.dirname(this.path);
|
|
26
|
-
this._content = null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
invalidate() {
|
|
30
|
-
this._content = null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
read(): PackageJson {
|
|
34
|
-
if (this._content == null) {
|
|
35
|
-
this._content = JSON.parse(fs.readFileSync(this.path, 'utf8'));
|
|
36
|
-
}
|
|
37
|
-
return this._content;
|
|
38
|
-
}
|
|
39
|
-
}
|