Rename RawMapping to MetroSourceMapSegmentTuple

Reviewed By: mjesun

Differential Revision: D6702878

fbshipit-source-id: d6063e2f356d24c91ff87760fa90bf909d49f98e
This commit is contained in:
Peter van der Zee 2018-01-12 01:01:56 -08:00 committed by Facebook Github Bot
parent 01ab028d4f
commit 4cf85b278f
2 changed files with 12 additions and 9 deletions

View File

@ -25,16 +25,16 @@ type GeneratedCodeMapping = [number, number];
type SourceMapping = [number, number, number, number];
type SourceMappingWithName = [number, number, number, number, string];
export type MetroSourceMapSegmentTuple =
| SourceMappingWithName
| SourceMapping
| GeneratedCodeMapping;
type FBExtensions = {
x_facebook_offsets: Array<number>,
x_metro_module_paths: Array<string>,
};
export type RawMapping =
| SourceMappingWithName
| SourceMapping
| GeneratedCodeMapping;
export type IndexMapSection = {
map: MetroSourceMap,
offset: {line: number, column: number},
@ -58,7 +58,7 @@ export type FBSourceMap = FBIndexMap | (BabelSourceMap & FBExtensions);
*/
function fromRawMappings(
modules: $ReadOnlyArray<{
+map: ?Array<RawMapping>,
+map: ?Array<MetroSourceMapSegmentTuple>,
+path: string,
+source: string,
+code: string,
@ -110,7 +110,7 @@ function toRawMappings(sourceMap: BabelSourceMap): Array<BabelRawMapping> {
return rawMappings;
}
function compactMapping(mapping: BabelRawMapping): RawMapping {
function compactMapping(mapping: BabelRawMapping): MetroSourceMapSegmentTuple {
const {column, line} = mapping.generated;
const {name, original} = mapping;

View File

@ -21,10 +21,13 @@ import type {GlobalTransformCache} from '../lib/GlobalTransformCache';
import type {TransformCache} from '../lib/TransformCaching';
import type {Reporter} from '../lib/reporting';
import type {HasteImpl} from '../node-haste/Module';
import type {MetroSourceMap as SourceMap, RawMapping} from 'metro-source-map';
import type {
MetroSourceMap as SourceMap,
MetroSourceMapSegmentTuple,
} from 'metro-source-map';
type BundleType = 'bundle' | 'delta' | 'map' | 'ram' | 'cli' | 'hmr' | 'todo';
type SourceMapOrMappings = SourceMap | Array<RawMapping>;
type SourceMapOrMappings = SourceMap | Array<MetroSourceMapSegmentTuple>;
export type BundleOptions = {
+assetPlugins: Array<string>,