@remotion/bundler 3.0.0-lambda.297 → 3.0.0-lambda.310
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/dist/dev-middleware/compatible.api.d.ts +1 -0
- package/dist/dev-middleware/compatible.api.d.ts.map +1 -0
- package/dist/dev-middleware/compatible.api.js +2 -0
- package/dist/dev-middleware/compatible.api.js.map +1 -0
- package/dist/dev-middleware/compatibleapi.d.ts +1 -0
- package/dist/dev-middleware/compatibleapi.d.ts.map +1 -0
- package/dist/dev-middleware/compatibleapi.js +2 -0
- package/dist/dev-middleware/compatibleapi.js.map +1 -0
- package/dist/error-overlay/entry-basic.js +13 -16
- package/dist/error-overlay/entry-basic.js.map +1 -1
- package/dist/error-overlay/entry-devserver.d.ts +12 -0
- package/dist/error-overlay/entry-devserver.d.ts.map +1 -0
- package/dist/error-overlay/entry-devserver.js +36 -0
- package/dist/error-overlay/entry-devserver.js.map +1 -0
- package/dist/error-overlay/index.d.ts +5 -0
- package/dist/error-overlay/index.d.ts.map +1 -0
- package/dist/error-overlay/index.js +28 -0
- package/dist/error-overlay/index.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js +19 -8
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js.map +1 -1
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts +2 -2
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +5 -11
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js.map +1 -1
- package/dist/error-overlay/react-overlay/index.d.ts +1 -7
- package/dist/error-overlay/react-overlay/index.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/index.js +8 -35
- package/dist/error-overlay/react-overlay/index.js.map +1 -1
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts +4 -5
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +25 -27
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js.map +1 -1
- package/dist/error-overlay/react-overlay/stack-frame.d.ts +47 -0
- package/dist/error-overlay/react-overlay/stack-frame.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/stack-frame.js +82 -0
- package/dist/error-overlay/react-overlay/stack-frame.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts +1 -1
- package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-lines-around.js +5 -11
- package/dist/error-overlay/react-overlay/utils/get-lines-around.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts +1 -16
- package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-source-map.js +4 -28
- package/dist/error-overlay/react-overlay/utils/get-source-map.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts +2 -9
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.js +7 -28
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/parser.d.ts +2 -13
- package/dist/error-overlay/react-overlay/utils/parser.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/parser.js +45 -11
- package/dist/error-overlay/react-overlay/utils/parser.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts +27 -24
- package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/stack-frame.js +21 -60
- package/dist/error-overlay/react-overlay/utils/stack-frame.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/unmapper.d.ts +2 -12
- package/dist/error-overlay/react-overlay/utils/unmapper.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/unmapper.js +34 -71
- package/dist/error-overlay/react-overlay/utils/unmapper.js.map +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts.map +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +5 -39
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js.map +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorLoader.d.ts +5 -0
- package/dist/error-overlay/remotion-overlay/ErrorLoader.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +62 -0
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorTitle.d.ts +7 -0
- package/dist/error-overlay/remotion-overlay/ErrorTitle.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js +42 -0
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +2 -2
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts.map +1 -1
- package/dist/error-overlay/remotion-overlay/Overlay.d.ts +2 -4
- package/dist/error-overlay/remotion-overlay/Overlay.d.ts.map +1 -1
- package/dist/error-overlay/remotion-overlay/Overlay.js +24 -9
- package/dist/error-overlay/remotion-overlay/Overlay.js.map +1 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +2 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts.map +1 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +4 -4
- package/dist/error-overlay/remotion-overlay/StackFrame.js.map +1 -1
- package/dist/error-overlay/remotion-overlay/Symbolicating.d.ts +3 -0
- package/dist/error-overlay/remotion-overlay/Symbolicating.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +9 -0
- package/dist/error-overlay/remotion-overlay/Symbolicating.js.map +1 -0
- package/dist/get-latest-remotion-version.d.ts +2 -0
- package/dist/get-latest-remotion-version.d.ts.map +1 -0
- package/dist/get-latest-remotion-version.js +32 -0
- package/dist/get-latest-remotion-version.js.map +1 -0
- package/dist/get-package-manager.d.ts +3 -0
- package/dist/get-package-manager.d.ts.map +1 -0
- package/dist/get-package-manager.js +41 -0
- package/dist/get-package-manager.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/setup-env-variables.d.ts +2 -0
- package/dist/setup-env-variables.d.ts.map +1 -0
- package/dist/setup-env-variables.js +5 -0
- package/dist/setup-env-variables.js.map +1 -0
- package/dist/start-server.d.ts.map +1 -1
- package/dist/start-server.js +3 -3
- package/dist/start-server.js.map +1 -1
- package/dist/test/latest-remotion-version.d.ts +2 -0
- package/dist/test/latest-remotion-version.d.ts.map +1 -0
- package/dist/test/latest-remotion-version.js +7 -0
- package/dist/test/latest-remotion-version.js.map +1 -0
- package/dist/test/latest-remotion-version.test.d.ts +2 -0
- package/dist/test/latest-remotion-version.test.d.ts.map +1 -0
- package/dist/test/latest-remotion-version.test.js +7 -0
- package/dist/test/latest-remotion-version.test.js.map +1 -0
- package/dist/test/parse-module-not-found.test.d.ts +2 -0
- package/dist/test/parse-module-not-found.test.d.ts.map +1 -0
- package/dist/test/parse-module-not-found.test.js +18 -0
- package/dist/test/parse-module-not-found.test.js.map +1 -0
- package/dist/update-available.d.ts +1 -1
- package/dist/update-available.d.ts.map +1 -1
- package/dist/update-available.js +5 -11
- package/dist/update-available.js.map +1 -1
- package/package.json +3 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack-frame.js","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/stack-frame.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,WAAW;AAEX,yCAAyC;AACzC,MAAM,UAAU;IAQf,YAAY,UAAkB,EAAE,OAAe,EAA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G;IACH,eAAe;QACd,OAAO,IAAI,CAAC,YAAY,IAAI,sBAAsB,CAAC;IACpD,CAAC;IAED;;;OAGG;IACH,SAAS;QACR,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE;YAC3B,GAAG,IAAI,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;SAC3B;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,EAAE;YAC7B,GAAG,IAAI,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;SAC7B;QAED,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI,EAAE;YAC/B,GAAG,IAAI,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC;SAC/B;QAED,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,QAAQ;QACP,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACzD,CAAC;CACD;AA9FD,gCA8FC"}
|
|
@@ -11,5 +11,5 @@ import { ScriptLine } from './stack-frame';
|
|
|
11
11
|
* @param {number} count The number of lines you'd like for context.
|
|
12
12
|
* @param {string[] | string} lines The source code.
|
|
13
13
|
*/
|
|
14
|
-
export declare function getLinesAround(line: number, count: number, lines: string[]
|
|
14
|
+
export declare function getLinesAround(line: number, count: number, lines: string[]): ScriptLine[];
|
|
15
15
|
//# sourceMappingURL=get-lines-around.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-lines-around.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-lines-around.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"get-lines-around.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-lines-around.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EAAE,GACb,UAAU,EAAE,CAed"}
|
|
@@ -4,13 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getLinesAround = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/
|
|
13
|
-
const stack_frame_1 = require("./stack-frame");
|
|
14
7
|
/**
|
|
15
8
|
*
|
|
16
9
|
* @param {number} line The line number to provide context around.
|
|
@@ -18,12 +11,13 @@ const stack_frame_1 = require("./stack-frame");
|
|
|
18
11
|
* @param {string[] | string} lines The source code.
|
|
19
12
|
*/
|
|
20
13
|
function getLinesAround(line, count, lines) {
|
|
21
|
-
if (typeof lines === 'string') {
|
|
22
|
-
lines = lines.split('\n');
|
|
23
|
-
}
|
|
24
14
|
const result = [];
|
|
25
15
|
for (let index = Math.max(0, line - 1 - count); index <= Math.min(lines.length - 1, line - 1 + count); ++index) {
|
|
26
|
-
result.push(
|
|
16
|
+
result.push({
|
|
17
|
+
lineNumber: index + 1,
|
|
18
|
+
content: lines[index],
|
|
19
|
+
highlight: index === line - 1,
|
|
20
|
+
});
|
|
27
21
|
}
|
|
28
22
|
return result;
|
|
29
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-lines-around.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-lines-around.ts"],"names":[],"mappings":";AAAA;;EAEE;;;
|
|
1
|
+
{"version":3,"file":"get-lines-around.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-lines-around.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAWF;;;;;GAKG;AACH,SAAgB,cAAc,CAC7B,IAAY,EACZ,KAAa,EACb,KAAe;IAEf,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,KACC,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,EACzC,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,EACrD,EAAE,KAAK,EACN;QACD,MAAM,CAAC,IAAI,CAAC;YACX,UAAU,EAAE,KAAK,GAAG,CAAC;YACrB,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC;YACrB,SAAS,EAAE,KAAK,KAAK,IAAI,GAAG,CAAC;SAC7B,CAAC,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAnBD,wCAmBC"}
|
|
@@ -10,7 +10,7 @@ import { SourceMapConsumer } from 'source-map';
|
|
|
10
10
|
*
|
|
11
11
|
* This exposes methods which will be indifferent to changes made in <code>{@link https://github.com/mozilla/source-map source-map}</code>.
|
|
12
12
|
*/
|
|
13
|
-
declare class SourceMap {
|
|
13
|
+
export declare class SourceMap {
|
|
14
14
|
__source_map: SourceMapConsumer;
|
|
15
15
|
constructor(sourceMap: SourceMapConsumer);
|
|
16
16
|
/**
|
|
@@ -23,22 +23,7 @@ declare class SourceMap {
|
|
|
23
23
|
line: number;
|
|
24
24
|
column: number;
|
|
25
25
|
};
|
|
26
|
-
/**
|
|
27
|
-
* Returns the generated code position for an original position.
|
|
28
|
-
* @param {string} source The source file of the original code position.
|
|
29
|
-
* @param {number} line The line of the original code position.
|
|
30
|
-
* @param {number} column The column of the original code position.
|
|
31
|
-
*/
|
|
32
|
-
getGeneratedPosition(source: string, line: number, column: number): {
|
|
33
|
-
line: number;
|
|
34
|
-
column: number;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Returns the code for a given source file name.
|
|
38
|
-
* @param {string} sourceName The name of the source file.
|
|
39
|
-
*/
|
|
40
26
|
getSource(sourceName: string): string;
|
|
41
|
-
getSources(): string[];
|
|
42
27
|
}
|
|
43
28
|
/**
|
|
44
29
|
* Returns an instance of <code>{@link SourceMap}</code> for a given fileUri and fileContents.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-source-map.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-source-map.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAE7C;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"get-source-map.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-source-map.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAE7C;;;;GAIG;AACH,qBAAa,SAAS;IACrB,YAAY,EAAE,iBAAiB,CAAC;gBAEpB,SAAS,EAAE,iBAAiB;IAIxC;;;;OAIG;IACH,mBAAmB,CAClB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACZ;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC;IAYjD,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAGrC;AA0BD;;;;GAIG;AACH,iBAAe,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,CAAC,CAqBpB;AAED,OAAO,EAAC,YAAY,EAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Source code adapted from https://github.com/facebook/create-react-app/tree/main/packages/react-error-overlay and refactored in Typescript. This file is MIT-licensed.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getSourceMap = void 0;
|
|
6
|
+
exports.getSourceMap = exports.SourceMap = void 0;
|
|
7
7
|
/* eslint-disable no-eq-null */
|
|
8
8
|
/* eslint-disable eqeqeq */
|
|
9
9
|
/**
|
|
@@ -34,35 +34,11 @@ class SourceMap {
|
|
|
34
34
|
});
|
|
35
35
|
return { line: l, column: c, source: s };
|
|
36
36
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Returns the generated code position for an original position.
|
|
39
|
-
* @param {string} source The source file of the original code position.
|
|
40
|
-
* @param {number} line The line of the original code position.
|
|
41
|
-
* @param {number} column The column of the original code position.
|
|
42
|
-
*/
|
|
43
|
-
getGeneratedPosition(source, line, column) {
|
|
44
|
-
const { line: l, column: c } = this.__source_map.generatedPositionFor({
|
|
45
|
-
source,
|
|
46
|
-
line,
|
|
47
|
-
column,
|
|
48
|
-
});
|
|
49
|
-
return {
|
|
50
|
-
line: l,
|
|
51
|
-
column: c,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Returns the code for a given source file name.
|
|
56
|
-
* @param {string} sourceName The name of the source file.
|
|
57
|
-
*/
|
|
58
37
|
getSource(sourceName) {
|
|
59
38
|
return this.__source_map.sourceContentFor(sourceName);
|
|
60
39
|
}
|
|
61
|
-
getSources() {
|
|
62
|
-
// @ts-expect-error
|
|
63
|
-
return this.__source_map.sources;
|
|
64
|
-
}
|
|
65
40
|
}
|
|
41
|
+
exports.SourceMap = SourceMap;
|
|
66
42
|
function extractSourceMapUrl(fileUri, fileContents) {
|
|
67
43
|
const regex = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;
|
|
68
44
|
let match = null;
|
|
@@ -94,12 +70,12 @@ async function getSourceMap(fileUri, fileContents) {
|
|
|
94
70
|
sm = sm.substring(match2[0].length);
|
|
95
71
|
sm = window.atob(sm);
|
|
96
72
|
sm = JSON.parse(sm);
|
|
97
|
-
return new SourceMap(
|
|
73
|
+
return new SourceMap(new source_map_1.SourceMapConsumer(sm));
|
|
98
74
|
}
|
|
99
75
|
const index = fileUri.lastIndexOf('/');
|
|
100
76
|
const url = fileUri.substring(0, index + 1) + sm;
|
|
101
77
|
const obj = await fetch(url).then((res) => res.json());
|
|
102
|
-
return new SourceMap(
|
|
78
|
+
return new SourceMap(new source_map_1.SourceMapConsumer(obj));
|
|
103
79
|
}
|
|
104
80
|
exports.getSourceMap = getSourceMap;
|
|
105
81
|
//# sourceMappingURL=get-source-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-source-map.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-source-map.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF,+BAA+B;AAC/B,2BAA2B;AAC3B;;;;;GAKG;AAEH,2CAA6C;AAE7C;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"get-source-map.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-source-map.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF,+BAA+B;AAC/B,2BAA2B;AAC3B;;;;;GAKG;AAEH,2CAA6C;AAE7C;;;;GAIG;AACH,MAAa,SAAS;IAGrB,YAAY,SAA4B;QACvC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CAClB,IAAY,EACZ,MAAc;QAEd,MAAM,EAC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EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,EAAE;YACZ,MAAM,IAAI,KAAK,CACd,gEAAgE,CAChE,CAAC;SACF;QAED,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACpC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpB,OAAO,IAAI,SAAS,CAAC,IAAI,8BAAiB,CAAC,EAAE,CAAC,CAAC,CAAC;KAChD;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACjD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACvD,OAAO,IAAI,SAAS,CAAC,IAAI,8BAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AAEO,oCAAY"}
|
|
@@ -4,13 +4,6 @@
|
|
|
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
|
-
import type {
|
|
8
|
-
declare
|
|
9
|
-
__unmap_source?: string | undefined;
|
|
10
|
-
};
|
|
11
|
-
declare function getStackFrames(error: UnmappedError, contextSize?: number): Promise<{
|
|
12
|
-
frames: StackFrame[] | null;
|
|
13
|
-
type: 'exception' | 'syntax';
|
|
14
|
-
}>;
|
|
15
|
-
export { getStackFrames };
|
|
7
|
+
import type { SymbolicatedStackFrame } from './stack-frame';
|
|
8
|
+
export declare const getStackFrames: (error: Error, contextSize: number) => Promise<SymbolicatedStackFrame[] | null>;
|
|
16
9
|
//# sourceMappingURL=get-stack-frames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-stack-frames.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-stack-frames.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"get-stack-frames.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-stack-frames.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAI1D,eAAO,MAAM,cAAc,UACnB,KAAK,eACC,MAAM,KACjB,QAAQ,sBAAsB,EAAE,GAAG,IAAI,CAiBzC,CAAC"}
|
|
@@ -6,38 +6,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getStackFrames = void 0;
|
|
7
7
|
const parser_1 = require("./parser");
|
|
8
8
|
const unmapper_1 = require("./unmapper");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
if (error.__unmap_source) {
|
|
13
|
-
return {
|
|
14
|
-
frames: await (0, unmapper_1.unmap)(error.__unmap_source, parsedFrames, contextSize),
|
|
15
|
-
type: 'exception',
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const location = (0, map_error_to_react_stack_1.getLocationFromBuildError)(error);
|
|
19
|
-
if (location === null) {
|
|
20
|
-
return { frames: [], type: 'exception' };
|
|
21
|
-
}
|
|
22
|
-
const frames = await (0, resolve_file_source_1.resolveFileSource)(location, contextSize);
|
|
23
|
-
return { frames: [frames], type: 'syntax' };
|
|
24
|
-
};
|
|
25
|
-
async function getStackFrames(error, contextSize = 3) {
|
|
26
|
-
const parsedFrames = (0, parser_1.parseError)(error);
|
|
27
|
-
const { frames: enhancedFrames, type } = await getEnhancedFrames(error, parsedFrames, contextSize);
|
|
9
|
+
const getStackFrames = async (error, contextSize) => {
|
|
10
|
+
const parsedFrames = await (0, parser_1.parseError)(error, contextSize);
|
|
11
|
+
const enhancedFrames = await (0, unmapper_1.unmap)(parsedFrames, contextSize);
|
|
28
12
|
if (enhancedFrames
|
|
29
|
-
.map((f) => f.
|
|
13
|
+
.map((f) => f.originalFileName)
|
|
30
14
|
.filter((f_1) => f_1 !== null &&
|
|
31
15
|
f_1 !== undefined &&
|
|
32
16
|
f_1.indexOf('node_modules') === -1).length === 0) {
|
|
33
|
-
return
|
|
17
|
+
return null;
|
|
34
18
|
}
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
frames: enhancedFrames.filter(({ functionName }) => functionName === null ||
|
|
38
|
-
functionName === undefined ||
|
|
39
|
-
functionName.indexOf('__stack_frame_overlay_proxy_console__') === -1),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
19
|
+
return enhancedFrames;
|
|
20
|
+
};
|
|
42
21
|
exports.getStackFrames = getStackFrames;
|
|
43
22
|
//# sourceMappingURL=get-stack-frames.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-stack-frames.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-stack-frames.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAUF,qCAAoC;AACpC,yCAAiC;
|
|
1
|
+
{"version":3,"file":"get-stack-frames.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-stack-frames.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAUF,qCAAoC;AACpC,yCAAiC;AAE1B,MAAM,cAAc,GAAG,KAAK,EAClC,KAAY,EACZ,WAAmB,EACwB,EAAE;IAC7C,MAAM,YAAY,GAAG,MAAM,IAAA,mBAAU,EAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAC1D,MAAM,cAAc,GAAG,MAAM,IAAA,gBAAK,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC9D,IACC,cAAc;SACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;SAC9B,MAAM,CACN,CAAC,GAAG,EAAE,EAAE,CACP,GAAG,KAAK,IAAI;QACZ,GAAG,KAAK,SAAS;QACjB,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CACnC,CAAC,MAAM,KAAK,CAAC,EACd;QACD,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AApBW,QAAA,cAAc,kBAoBzB"}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
import { StackFrame } from './stack-frame';
|
|
8
|
-
/**
|
|
9
|
-
* Turns an <code>Error</code>, or similar object, into a set of <code>StackFrame</code>s.
|
|
10
|
-
* @alias parse
|
|
11
|
-
*/
|
|
12
|
-
declare function parseError(error: Error | string | string[]): StackFrame[];
|
|
13
|
-
export { parseError };
|
|
1
|
+
import { SomeStackFrame } from './stack-frame';
|
|
2
|
+
export declare const parseError: (error: Error | string | string[], contextLines: number) => Promise<SomeStackFrame[]>;
|
|
14
3
|
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/parser.ts"],"names":[],"mappings":"AAaA,OAAO,EAAiB,cAAc,EAAa,MAAM,eAAe,CAAC;AAkFzE,eAAO,MAAM,UAAU,UACf,KAAK,GAAG,MAAM,GAAG,MAAM,EAAE,gBAClB,MAAM,KAClB,QAAQ,cAAc,EAAE,CA4C1B,CAAC"}
|
|
@@ -10,6 +10,8 @@ exports.parseError = void 0;
|
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
+
const map_error_to_react_stack_1 = require("../effects/map-error-to-react-stack");
|
|
14
|
+
const resolve_file_source_1 = require("../effects/resolve-file-source");
|
|
13
15
|
const stack_frame_1 = require("./stack-frame");
|
|
14
16
|
const regexExtractLocation = /\(?(.+?)(?::(\d+))?(?::(\d+))?\)?$/;
|
|
15
17
|
function extractLocation(token) {
|
|
@@ -43,7 +45,13 @@ function parseStack(stack) {
|
|
|
43
45
|
if (!_last) {
|
|
44
46
|
throw new Error('could not get last');
|
|
45
47
|
}
|
|
46
|
-
|
|
48
|
+
const [_fileName, _lineNumber, _columnNumber] = extractLocation(_last);
|
|
49
|
+
return (0, stack_frame_1.makeStackFrame)({
|
|
50
|
+
functionName: _data.join('@') || (isEval ? 'eval' : null),
|
|
51
|
+
fileName: _fileName,
|
|
52
|
+
lineNumber: _lineNumber,
|
|
53
|
+
columnNumber: _columnNumber,
|
|
54
|
+
});
|
|
47
55
|
}
|
|
48
56
|
// Strip eval, we don't care about it
|
|
49
57
|
if (e.indexOf('(eval ') !== -1) {
|
|
@@ -57,28 +65,54 @@ function parseStack(stack) {
|
|
|
57
65
|
if (!last) {
|
|
58
66
|
throw new Error('could not get last');
|
|
59
67
|
}
|
|
60
|
-
|
|
68
|
+
const [fileName, lineNumber, columnNumber] = extractLocation(last);
|
|
69
|
+
return (0, stack_frame_1.makeStackFrame)({
|
|
70
|
+
functionName: data.join(' ') || null,
|
|
71
|
+
fileName,
|
|
72
|
+
lineNumber,
|
|
73
|
+
columnNumber,
|
|
74
|
+
});
|
|
61
75
|
});
|
|
62
76
|
return frames;
|
|
63
77
|
}
|
|
64
|
-
|
|
65
|
-
* Turns an <code>Error</code>, or similar object, into a set of <code>StackFrame</code>s.
|
|
66
|
-
* @alias parse
|
|
67
|
-
*/
|
|
68
|
-
function parseError(error) {
|
|
78
|
+
const parseError = async (error, contextLines) => {
|
|
69
79
|
if (error === null) {
|
|
70
80
|
throw new Error('You cannot pass a null object.');
|
|
71
81
|
}
|
|
72
82
|
if (typeof error === 'string') {
|
|
73
|
-
return parseStack(error.split('\n'))
|
|
83
|
+
return parseStack(error.split('\n')).map((frame) => {
|
|
84
|
+
return {
|
|
85
|
+
type: 'transpiled',
|
|
86
|
+
frame,
|
|
87
|
+
};
|
|
88
|
+
});
|
|
74
89
|
}
|
|
75
90
|
if (Array.isArray(error)) {
|
|
76
|
-
return parseStack(error)
|
|
91
|
+
return parseStack(error).map((frame) => {
|
|
92
|
+
return {
|
|
93
|
+
type: 'transpiled',
|
|
94
|
+
frame,
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const errorLocation = (0, map_error_to_react_stack_1.getLocationFromBuildError)(error);
|
|
99
|
+
if (errorLocation) {
|
|
100
|
+
return [
|
|
101
|
+
{
|
|
102
|
+
type: 'symbolicated',
|
|
103
|
+
frame: await (0, resolve_file_source_1.resolveFileSource)(errorLocation, contextLines),
|
|
104
|
+
},
|
|
105
|
+
];
|
|
77
106
|
}
|
|
78
107
|
if (typeof error.stack === 'string') {
|
|
79
|
-
return parseStack(error.stack.split('\n'))
|
|
108
|
+
return parseStack(error.stack.split('\n')).map((frame) => {
|
|
109
|
+
return {
|
|
110
|
+
type: 'transpiled',
|
|
111
|
+
frame,
|
|
112
|
+
};
|
|
113
|
+
});
|
|
80
114
|
}
|
|
81
115
|
throw new Error('The error you provided does not contain a stack trace.');
|
|
82
|
-
}
|
|
116
|
+
};
|
|
83
117
|
exports.parseError = parseError;
|
|
84
118
|
//# sourceMappingURL=parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/parser.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF;;;;;GAKG;AAEH,+
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/parser.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF;;;;;GAKG;AAEH,kFAA8E;AAC9E,wEAAiE;AACjE,+CAAyE;AAEzE,MAAM,oBAAoB,GAAG,oCAAoC,CAAC;AAElE,SAAS,eAAe,CAAC,KAAa;IACrC,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;KACtD;IAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAChC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;YACd,OAAO,CAAC,CAAC;SACT;QAED,OAAO,CAAC,CAAC;IACV,CAAC,CAA6B,CAAC;AAChC,CAAC;AAED,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AACvD,MAAM,uBAAuB,GAC5B,mDAAmD,CAAC;AAErD,SAAS,UAAU,CAAC,KAAe;IAClC,MAAM,MAAM,GAAG,KAAK;SAClB,MAAM,CACN,CAAC,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,CACxE;SACA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACV,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;YACpC,qCAAqC;YACrC,IAAI,MAAM,GAAG,KAAK,CAAC;YACnB,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;gBACjC,CAAC,GAAG,CAAC,CAAC,OAAO,CACZ,6DAA6D,EAC7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AC,GAAG,CAAC,CAAC,KAAK,EAAkB,EAAE;YACxE,OAAO;gBACN,IAAI,EAAE,YAAY;gBAClB,KAAK;aACL,CAAC;QACH,CAAC,CAAC,CAAC;KACH;IAED,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;AAC3E,CAAC,CAAC;AA/CW,QAAA,UAAU,cA+CrB"}
|
|
@@ -4,35 +4,38 @@
|
|
|
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
|
-
|
|
8
|
-
export declare class ScriptLine {
|
|
9
|
-
/** The line number of this line of source. */
|
|
7
|
+
export declare type ScriptLine = {
|
|
10
8
|
lineNumber: number;
|
|
11
|
-
/** The content (or value) of this line of source. */
|
|
12
9
|
content: string;
|
|
13
|
-
/** Whether or not this line should be highlighted. Particularly useful for error reporting with context. */
|
|
14
10
|
highlight: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
};
|
|
12
|
+
export declare type SymbolicatedStackFrame = {
|
|
13
|
+
originalFunctionName: string | null;
|
|
14
|
+
originalFileName: string | null;
|
|
15
|
+
originalLineNumber: number | null;
|
|
16
|
+
originalColumnNumber: number | null;
|
|
17
|
+
originalScriptCode: ScriptLine[] | null;
|
|
18
|
+
};
|
|
19
|
+
export declare type StackFrame = {
|
|
20
|
+
functionName: string | null;
|
|
21
|
+
fileName: string;
|
|
22
|
+
lineNumber: number;
|
|
23
|
+
columnNumber: number;
|
|
24
|
+
};
|
|
25
|
+
export declare type SomeStackFrame = {
|
|
26
|
+
type: 'symbolicated';
|
|
27
|
+
frame: SymbolicatedStackFrame;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'transpiled';
|
|
30
|
+
frame: StackFrame;
|
|
31
|
+
};
|
|
17
32
|
/**
|
|
18
33
|
* A representation of a stack frame.
|
|
19
34
|
*/
|
|
20
|
-
export declare
|
|
35
|
+
export declare const makeStackFrame: ({ functionName, fileName, lineNumber, columnNumber, }: {
|
|
21
36
|
functionName: string | null;
|
|
22
|
-
fileName: string
|
|
23
|
-
lineNumber: number
|
|
24
|
-
columnNumber: number
|
|
25
|
-
|
|
26
|
-
_originalFileName: string | null;
|
|
27
|
-
_originalLineNumber: number | null;
|
|
28
|
-
_originalColumnNumber: number | null;
|
|
29
|
-
_scriptCode: ScriptLine[] | null;
|
|
30
|
-
_originalScriptCode: ScriptLine[] | null;
|
|
31
|
-
constructor(functionName?: string | null, fileName?: string | null, lineNumber?: number | null, columnNumber?: number | null, scriptCode?: ScriptLine[] | null, sourceFunctionName?: string | null, sourceFileName?: string | null, sourceLineNumber?: number | null, sourceColumnNumber?: number | null, sourceScriptCode?: ScriptLine[] | null);
|
|
32
|
-
/**
|
|
33
|
-
* Returns the source of the frame.
|
|
34
|
-
* This contains the file name, line number, and column number when available.
|
|
35
|
-
*/
|
|
36
|
-
getSource(): string;
|
|
37
|
-
}
|
|
37
|
+
fileName: string;
|
|
38
|
+
lineNumber: number;
|
|
39
|
+
columnNumber: number;
|
|
40
|
+
}) => StackFrame;
|
|
38
41
|
//# sourceMappingURL=stack-frame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-frame.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/stack-frame.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,
|
|
1
|
+
{"version":3,"file":"stack-frame.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/stack-frame.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,oBAAY,UAAU,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACpC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,kBAAkB,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;CACxC,CAAC;AAEF,oBAAY,UAAU,GAAG;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,cAAc,GACvB;IACA,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,sBAAsB,CAAC;CAC7B,GACD;IACA,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;CACjB,CAAC;AAEL;;GAEG;AAEH,eAAO,MAAM,cAAc;kBAMZ,MAAM,GAAG,IAAI;cACjB,MAAM;gBACJ,MAAM;kBACJ,MAAM;MACjB,UAuBH,CAAC"}
|
|
@@ -3,69 +3,30 @@
|
|
|
3
3
|
Source code adapted from https://github.com/facebook/create-react-app/tree/main/packages/react-error-overlay and refactored in Typescript. This file is MIT-licensed.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
/**
|
|
8
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/
|
|
13
|
-
/** A container holding a script line. */
|
|
14
|
-
class ScriptLine {
|
|
15
|
-
constructor(lineNumber, content, highlight = false) {
|
|
16
|
-
this.lineNumber = lineNumber;
|
|
17
|
-
this.content = content;
|
|
18
|
-
this.highlight = highlight;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.ScriptLine = ScriptLine;
|
|
6
|
+
exports.makeStackFrame = void 0;
|
|
22
7
|
/**
|
|
23
8
|
* A representation of a stack frame.
|
|
24
9
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (functionName && functionName.indexOf('Object.') === 0) {
|
|
29
|
-
functionName = functionName.slice('Object.'.length);
|
|
30
|
-
}
|
|
31
|
-
if (
|
|
32
|
-
// Chrome has a bug with inferring function.name:
|
|
33
|
-
// https://github.com/facebook/create-react-app/issues/2097
|
|
34
|
-
// Let's ignore a meaningless name we get for top-level modules.
|
|
35
|
-
functionName === 'friendlySyntaxErrorLabel' ||
|
|
36
|
-
functionName === 'exports.__esModule' ||
|
|
37
|
-
functionName === '<anonymous>' ||
|
|
38
|
-
!functionName) {
|
|
39
|
-
functionName = null;
|
|
40
|
-
}
|
|
41
|
-
this.functionName = functionName;
|
|
42
|
-
this.fileName = fileName;
|
|
43
|
-
this.lineNumber = lineNumber;
|
|
44
|
-
this.columnNumber = columnNumber;
|
|
45
|
-
this._originalFunctionName = sourceFunctionName;
|
|
46
|
-
this._originalFileName = sourceFileName;
|
|
47
|
-
this._originalLineNumber = sourceLineNumber;
|
|
48
|
-
this._originalColumnNumber = sourceColumnNumber;
|
|
49
|
-
this._scriptCode = scriptCode;
|
|
50
|
-
this._originalScriptCode = sourceScriptCode;
|
|
10
|
+
const makeStackFrame = ({ functionName, fileName, lineNumber, columnNumber, }) => {
|
|
11
|
+
if (functionName && functionName.indexOf('Object.') === 0) {
|
|
12
|
+
functionName = functionName.slice('Object.'.length);
|
|
51
13
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (this.lineNumber !== null) {
|
|
62
|
-
str += this.lineNumber + ':';
|
|
63
|
-
}
|
|
64
|
-
if (this.columnNumber !== null) {
|
|
65
|
-
str += this.columnNumber + ':';
|
|
66
|
-
}
|
|
67
|
-
return str.slice(0, -1);
|
|
14
|
+
if (
|
|
15
|
+
// Chrome has a bug with inferring function.name:
|
|
16
|
+
// https://github.com/facebook/create-react-app/issues/2097
|
|
17
|
+
// Let's ignore a meaningless name we get for top-level modules.
|
|
18
|
+
functionName === 'friendlySyntaxErrorLabel' ||
|
|
19
|
+
functionName === 'exports.__esModule' ||
|
|
20
|
+
functionName === '<anonymous>' ||
|
|
21
|
+
!functionName) {
|
|
22
|
+
functionName = null;
|
|
68
23
|
}
|
|
69
|
-
|
|
70
|
-
|
|
24
|
+
return {
|
|
25
|
+
columnNumber,
|
|
26
|
+
fileName,
|
|
27
|
+
functionName,
|
|
28
|
+
lineNumber,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.makeStackFrame = makeStackFrame;
|
|
71
32
|
//# sourceMappingURL=stack-frame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-frame.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/stack-frame.ts"],"names":[],"mappings":";AAAA;;EAEE;;;
|
|
1
|
+
{"version":3,"file":"stack-frame.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/stack-frame.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAwCF;;GAEG;AAEI,MAAM,cAAc,GAAG,CAAC,EAC9B,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,YAAY,GAMZ,EAAc,EAAE;IAChB,IAAI,YAAY,IAAI,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;QAC1D,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;KACpD;IAED;IACC,iDAAiD;IACjD,2DAA2D;IAC3D,gEAAgE;IAChE,YAAY,KAAK,0BAA0B;QAC3C,YAAY,KAAK,oBAAoB;QACrC,YAAY,KAAK,aAAa;QAC9B,CAAC,YAAY,EACZ;QACD,YAAY,GAAG,IAAI,CAAC;KACpB;IAED,OAAO;QACN,YAAY;QACZ,QAAQ;QACR,YAAY;QACZ,UAAU;KACV,CAAC;AACH,CAAC,CAAC;AAjCW,QAAA,cAAc,kBAiCzB"}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Turns a set of mapped <code>StackFrame</code>s back into their generated code position and enhances them with code.
|
|
4
|
-
* @param {string} fileUri The URI of the <code>bundle.js</code> file.
|
|
5
|
-
* @param {StackFrame[]} frames A set of <code>StackFrame</code>s which are already mapped and missing their generated positions.
|
|
6
|
-
* @param {number} [fileContents=3] The number of lines to provide before and after the line specified in the <code>StackFrame</code>.
|
|
7
|
-
*/
|
|
8
|
-
declare function unmap(_fileUri: string | {
|
|
9
|
-
uri: string;
|
|
10
|
-
contents: string;
|
|
11
|
-
}, frames: StackFrame[], contextLines: number): Promise<StackFrame[]>;
|
|
12
|
-
export { unmap };
|
|
1
|
+
import { SomeStackFrame, SymbolicatedStackFrame } from './stack-frame';
|
|
2
|
+
export declare const unmap: (frames: SomeStackFrame[], contextLines: number) => Promise<SymbolicatedStackFrame[]>;
|
|
13
3
|
//# sourceMappingURL=unmapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unmapper.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/unmapper.ts"],"names":[],"mappings":"AAgBA,OAAO,
|
|
1
|
+
{"version":3,"file":"unmapper.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/unmapper.ts"],"names":[],"mappings":"AAgBA,OAAO,EACN,cAAc,EAEd,sBAAsB,EACtB,MAAM,eAAe,CAAC;AASvB,eAAO,MAAM,KAAK,WACT,cAAc,EAAE,gBACV,MAAM,KAClB,QAAQ,sBAAsB,EAAE,CA4ClC,CAAC"}
|