metro-source-map 0.70.2 → 0.71.1
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 +3 -3
- package/src/BundleBuilder.js.flow +2 -2
- package/src/Consumer/MappingsConsumer.js +1 -0
- package/src/Consumer/MappingsConsumer.js.flow +1 -0
- package/src/Consumer/types.flow.js.flow +1 -1
- package/src/Generator.js.flow +2 -2
- package/src/composeSourceMaps.js +1 -1
- package/src/composeSourceMaps.js.flow +5 -3
- package/src/generateFunctionMap.js.flow +2 -1
- package/src/source-map.js.flow +6 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metro-source-map",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.71.1",
|
|
4
4
|
"description": "🚇 Source map generator for Metro.",
|
|
5
5
|
"main": "src/source-map.js",
|
|
6
6
|
"repository": {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"@babel/traverse": "^7.14.0",
|
|
16
16
|
"@babel/types": "^7.0.0",
|
|
17
17
|
"invariant": "^2.2.4",
|
|
18
|
-
"metro-symbolicate": "0.
|
|
18
|
+
"metro-symbolicate": "0.71.1",
|
|
19
19
|
"nullthrows": "^1.1.1",
|
|
20
|
-
"ob1": "0.
|
|
20
|
+
"ob1": "0.71.1",
|
|
21
21
|
"source-map": "^0.5.6",
|
|
22
22
|
"vlq": "^1.0.0"
|
|
23
23
|
},
|
|
@@ -98,10 +98,10 @@ class BundleBuilder {
|
|
|
98
98
|
|
|
99
99
|
const reLineBreak = /\r\n|\r|\n/g;
|
|
100
100
|
|
|
101
|
-
function measureString(str: string): {
|
|
101
|
+
function measureString(str: string): {
|
|
102
102
|
lineBreaks: number,
|
|
103
103
|
lastLineColumns: number,
|
|
104
|
-
|
|
104
|
+
} {
|
|
105
105
|
let lineBreaks = 0;
|
|
106
106
|
let match;
|
|
107
107
|
let lastLineStart = 0;
|
|
@@ -60,6 +60,7 @@ class MappingsConsumer extends AbstractConsumer implements IConsumer {
|
|
|
60
60
|
invariant(
|
|
61
61
|
generatedPosition.bias === GREATEST_LOWER_BOUND,
|
|
62
62
|
`Unimplemented lookup bias: ${lookupBiasToString(
|
|
63
|
+
// $FlowFixMe[incompatible-call]
|
|
63
64
|
generatedPosition.bias,
|
|
64
65
|
)}`,
|
|
65
66
|
);
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import type {IterationOrder, LookupBias} from './constants';
|
|
14
14
|
import type {Number0, Number1} from 'ob1';
|
|
15
15
|
export type {IterationOrder, LookupBias};
|
|
16
|
-
export type GeneratedOffset = {
|
|
16
|
+
export type GeneratedOffset = {+lines: Number0, +columns: Number0};
|
|
17
17
|
export type SourcePosition = {
|
|
18
18
|
source: ?string,
|
|
19
19
|
line: ?Number1,
|
package/src/Generator.js.flow
CHANGED
|
@@ -31,14 +31,14 @@ const B64Builder = require('./B64Builder');
|
|
|
31
31
|
*/
|
|
32
32
|
class Generator {
|
|
33
33
|
builder: B64Builder;
|
|
34
|
-
last: {
|
|
34
|
+
last: {
|
|
35
35
|
generatedColumn: number,
|
|
36
36
|
generatedLine: number,
|
|
37
37
|
name: number,
|
|
38
38
|
source: number,
|
|
39
39
|
sourceColumn: number,
|
|
40
40
|
sourceLine: number,
|
|
41
|
-
|
|
41
|
+
};
|
|
42
42
|
names: IndexedSet;
|
|
43
43
|
source: number;
|
|
44
44
|
sources: Array<string>;
|
package/src/composeSourceMaps.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
+
import type {SourcePosition} from './Consumer/types.flow';
|
|
13
14
|
import type {IConsumer, MixedSourceMap} from './source-map';
|
|
14
15
|
import type {Number0, Number1} from 'ob1';
|
|
15
16
|
|
|
@@ -93,9 +94,9 @@ function findOriginalPosition(
|
|
|
93
94
|
name: ?string,
|
|
94
95
|
...
|
|
95
96
|
} {
|
|
96
|
-
let currentLine = generatedLine;
|
|
97
|
-
let currentColumn = generatedColumn;
|
|
98
|
-
let original = {
|
|
97
|
+
let currentLine: ?Number1 = generatedLine;
|
|
98
|
+
let currentColumn: ?Number0 = generatedColumn;
|
|
99
|
+
let original: SourcePosition = {
|
|
99
100
|
line: null,
|
|
100
101
|
column: null,
|
|
101
102
|
source: null,
|
|
@@ -123,6 +124,7 @@ function findOriginalPosition(
|
|
|
123
124
|
};
|
|
124
125
|
}
|
|
125
126
|
}
|
|
127
|
+
// $FlowFixMe[incompatible-return] `Number0`, `Number1` is incompatible with number
|
|
126
128
|
return original;
|
|
127
129
|
}
|
|
128
130
|
|
|
@@ -190,7 +190,8 @@ function getNameForPath(path: NodePath<>): string {
|
|
|
190
190
|
return node.id.name;
|
|
191
191
|
}
|
|
192
192
|
let propertyPath;
|
|
193
|
-
let kind
|
|
193
|
+
let kind: ?(string | $TEMPORARY$string<'get'> | $TEMPORARY$string<'set'>) =
|
|
194
|
+
'';
|
|
194
195
|
|
|
195
196
|
// Find or construct an AST node that names the current node.
|
|
196
197
|
if (isObjectMethod(node) || isClassMethod(node)) {
|
package/src/source-map.js.flow
CHANGED
|
@@ -37,14 +37,14 @@ export type HermesFunctionOffsets = {[number]: $ReadOnlyArray<number>, ...};
|
|
|
37
37
|
|
|
38
38
|
export type FBSourcesArray = $ReadOnlyArray<?FBSourceMetadata>;
|
|
39
39
|
export type FBSourceMetadata = [?FBSourceFunctionMap];
|
|
40
|
-
export type FBSourceFunctionMap = {
|
|
40
|
+
export type FBSourceFunctionMap = {
|
|
41
41
|
+names: $ReadOnlyArray<string>,
|
|
42
42
|
+mappings: string,
|
|
43
|
-
|
|
43
|
+
};
|
|
44
44
|
|
|
45
45
|
export type FBSegmentMap = {[id: string]: MixedSourceMap, ...};
|
|
46
46
|
|
|
47
|
-
export type BasicSourceMap = {
|
|
47
|
+
export type BasicSourceMap = {
|
|
48
48
|
+file?: string,
|
|
49
49
|
+mappings: string,
|
|
50
50
|
+names: Array<string>,
|
|
@@ -57,7 +57,7 @@ export type BasicSourceMap = {|
|
|
|
57
57
|
+x_facebook_sources?: FBSourcesArray,
|
|
58
58
|
+x_facebook_segments?: FBSegmentMap,
|
|
59
59
|
+x_hermes_function_offsets?: HermesFunctionOffsets,
|
|
60
|
-
|
|
60
|
+
};
|
|
61
61
|
|
|
62
62
|
export type IndexMapSection = {
|
|
63
63
|
map: IndexMap | BasicSourceMap,
|
|
@@ -69,7 +69,7 @@ export type IndexMapSection = {
|
|
|
69
69
|
...
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
export type IndexMap = {
|
|
72
|
+
export type IndexMap = {
|
|
73
73
|
+file?: string,
|
|
74
74
|
+mappings?: void, // avoids SourceMap being a disjoint union
|
|
75
75
|
+sourcesContent?: void,
|
|
@@ -80,7 +80,7 @@ export type IndexMap = {|
|
|
|
80
80
|
+x_facebook_sources?: void,
|
|
81
81
|
+x_facebook_segments?: FBSegmentMap,
|
|
82
82
|
+x_hermes_function_offsets?: HermesFunctionOffsets,
|
|
83
|
-
|
|
83
|
+
};
|
|
84
84
|
|
|
85
85
|
export type MixedSourceMap = IndexMap | BasicSourceMap;
|
|
86
86
|
|