@remotion/bundler 3.0.0-lambda.279 → 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/range-parser.d.ts +1 -1
- package/dist/error-overlay/entry-basic.js +13 -13
- package/dist/error-overlay/entry-basic.js.map +1 -1
- package/dist/error-overlay/react-overlay/effects/format-warning.d.ts +1 -2
- package/dist/error-overlay/react-overlay/effects/format-warning.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/effects/format-warning.js +3 -3
- package/dist/error-overlay/react-overlay/effects/format-warning.js.map +1 -1
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts +8 -0
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js +47 -0
- package/dist/error-overlay/react-overlay/effects/map-error-to-react-stack.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/proxy-console.d.ts +10 -3
- package/dist/error-overlay/react-overlay/effects/proxy-console.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/effects/proxy-console.js +11 -1
- package/dist/error-overlay/react-overlay/effects/proxy-console.js.map +1 -1
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts +4 -0
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +32 -0
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js.map +1 -0
- package/dist/error-overlay/react-overlay/index.d.ts +2 -7
- package/dist/error-overlay/react-overlay/index.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/index.js +10 -33
- package/dist/error-overlay/react-overlay/index.js.map +1 -1
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts +4 -7
- 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 +41 -33
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/get-file-source.d.ts +2 -0
- package/dist/error-overlay/react-overlay/utils/get-file-source.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-file-source.js +22 -0
- package/dist/error-overlay/react-overlay/utils/get-file-source.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 -18
- 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 +3 -30
- 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 -6
- 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 +11 -21
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/open-in-editor.d.ts +0 -2
- package/dist/error-overlay/react-overlay/utils/open-in-editor.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/open-in-editor.js +2 -4
- package/dist/error-overlay/react-overlay/utils/open-in-editor.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/parser.d.ts +2 -14
- package/dist/error-overlay/react-overlay/utils/parser.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/parser.js +47 -14
- package/dist/error-overlay/react-overlay/utils/parser.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts +27 -32
- 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 -74
- package/dist/error-overlay/react-overlay/utils/stack-frame.js.map +1 -1
- package/dist/error-overlay/react-overlay/utils/unmapper.d.ts +2 -13
- package/dist/error-overlay/react-overlay/utils/unmapper.d.ts.map +1 -1
- package/dist/error-overlay/react-overlay/utils/unmapper.js +34 -72
- 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 +19 -35
- 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 +3 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts.map +1 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +5 -3
- 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/hot-middleware/process-update.d.ts.map +1 -1
- package/dist/hot-middleware/process-update.js +6 -4
- package/dist/hot-middleware/process-update.js.map +1 -1
- package/dist/hot-middleware/strip-ansi.d.ts +0 -5
- package/dist/hot-middleware/strip-ansi.d.ts.map +1 -1
- package/dist/hot-middleware/strip-ansi.js +2 -3
- package/dist/hot-middleware/strip-ansi.js.map +1 -1
- 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-environment.js +1 -0
- package/dist/setup-environment.js.map +1 -1
- package/dist/start-server.d.ts.map +1 -1
- package/dist/start-server.js +20 -3
- package/dist/start-server.js.map +1 -1
- package/dist/test/expect-to-throw.d.ts +2 -0
- package/dist/test/expect-to-throw.d.ts.map +1 -0
- package/dist/test/expect-to-throw.js +15 -0
- package/dist/test/expect-to-throw.js.map +1 -0
- 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-error-stack.test.d.ts +2 -0
- package/dist/test/parse-error-stack.test.d.ts.map +1 -0
- package/dist/test/parse-error-stack.test.js +18 -0
- package/dist/test/parse-error-stack.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/test/secure-source-read.test.d.ts +2 -0
- package/dist/test/secure-source-read.test.d.ts.map +1 -0
- package/dist/test/secure-source-read.test.js +9 -0
- package/dist/test/secure-source-read.test.js.map +1 -0
- package/dist/update-available.d.ts +2 -2
- 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/dist/webpack-cache.d.ts +0 -1
- package/dist/webpack-cache.d.ts.map +1 -1
- package/dist/webpack-cache.js +2 -3
- package/dist/webpack-cache.js.map +1 -1
- package/package.json +6 -5
|
@@ -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,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
|
|
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 = exports.
|
|
6
|
+
exports.getSourceMap = exports.SourceMap = void 0;
|
|
7
7
|
/* eslint-disable no-eq-null */
|
|
8
8
|
/* eslint-disable eqeqeq */
|
|
9
9
|
/**
|
|
@@ -34,34 +34,9 @@ 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
|
}
|
|
66
41
|
exports.SourceMap = SourceMap;
|
|
67
42
|
function extractSourceMapUrl(fileUri, fileContents) {
|
|
@@ -79,7 +54,6 @@ function extractSourceMapUrl(fileUri, fileContents) {
|
|
|
79
54
|
}
|
|
80
55
|
return Promise.resolve(match[1].toString());
|
|
81
56
|
}
|
|
82
|
-
exports.extractSourceMapUrl = extractSourceMapUrl;
|
|
83
57
|
/**
|
|
84
58
|
* Returns an instance of <code>{@link SourceMap}</code> for a given fileUri and fileContents.
|
|
85
59
|
* @param {string} fileUri The URI of the source file.
|
|
@@ -96,13 +70,12 @@ async function getSourceMap(fileUri, fileContents) {
|
|
|
96
70
|
sm = sm.substring(match2[0].length);
|
|
97
71
|
sm = window.atob(sm);
|
|
98
72
|
sm = JSON.parse(sm);
|
|
99
|
-
return new SourceMap(
|
|
73
|
+
return new SourceMap(new source_map_1.SourceMapConsumer(sm));
|
|
100
74
|
}
|
|
101
75
|
const index = fileUri.lastIndexOf('/');
|
|
102
76
|
const url = fileUri.substring(0, index + 1) + sm;
|
|
103
77
|
const obj = await fetch(url).then((res) => res.json());
|
|
104
|
-
return new SourceMap(
|
|
78
|
+
return new SourceMap(new source_map_1.SourceMapConsumer(obj));
|
|
105
79
|
}
|
|
106
80
|
exports.getSourceMap = getSourceMap;
|
|
107
|
-
exports.default = getSourceMap;
|
|
108
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,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,EACL,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,GACT,GAAG,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC;YACzC,IAAI;YACJ,MAAM;SACN,CAAC,CAAC;QACH,OAAO,EAAC,IAAI,EAAE,CAAW,EAAE,MAAM,EAAE,CAAW,EAAE,MAAM,EAAE,CAAW,EAAC,CAAC;IACtE,CAAC;IAED
|
|
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,EACL,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,GACT,GAAG,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC;YACzC,IAAI;YACJ,MAAM;SACN,CAAC,CAAC;QACH,OAAO,EAAC,IAAI,EAAE,CAAW,EAAE,MAAM,EAAE,CAAW,EAAE,MAAM,EAAE,CAAW,EAAC,CAAC;IACtE,CAAC;IAED,SAAS,CAAC,UAAkB;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,gBAAgB,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C;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,10 +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;
|
|
10
|
-
}, contextSize?: number): Promise<StackFrame[] | null>;
|
|
11
|
-
export default getStackFrames;
|
|
12
|
-
export { getStackFrames };
|
|
7
|
+
import type { SymbolicatedStackFrame } from './stack-frame';
|
|
8
|
+
export declare const getStackFrames: (error: Error, contextSize: number) => Promise<SymbolicatedStackFrame[] | null>;
|
|
13
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"}
|
|
@@ -5,28 +5,18 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getStackFrames = void 0;
|
|
7
7
|
const parser_1 = require("./parser");
|
|
8
|
-
const mapper_1 = require("./mapper");
|
|
9
8
|
const unmapper_1 = require("./unmapper");
|
|
10
|
-
|
|
11
|
-
const parsedFrames = (0, parser_1.
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
|
|
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);
|
|
12
|
+
if (enhancedFrames
|
|
13
|
+
.map((f) => f.originalFileName)
|
|
14
|
+
.filter((f_1) => f_1 !== null &&
|
|
15
|
+
f_1 !== undefined &&
|
|
16
|
+
f_1.indexOf('node_modules') === -1).length === 0) {
|
|
17
|
+
return null;
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
return enhancedFramesPromise.then((enhancedFrames) => {
|
|
20
|
-
if (enhancedFrames
|
|
21
|
-
.map((f) => f._originalFileName)
|
|
22
|
-
.filter((f) => f !== null && f !== undefined && f.indexOf('node_modules') === -1).length === 0) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
return enhancedFrames.filter(({ functionName }) => functionName === null ||
|
|
26
|
-
functionName === undefined ||
|
|
27
|
-
functionName.indexOf('__stack_frame_overlay_proxy_console__') === -1);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
19
|
+
return enhancedFrames;
|
|
20
|
+
};
|
|
30
21
|
exports.getStackFrames = getStackFrames;
|
|
31
|
-
exports.default = getStackFrames;
|
|
32
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,
|
|
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,5 +1,3 @@
|
|
|
1
|
-
export declare const isVsCodeDerivative: (editor: Editor) => boolean;
|
|
2
|
-
export declare function isTerminalEditor(editor: Editor): boolean;
|
|
3
1
|
declare const editorNames: readonly ["atom", "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta", "brackets", "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl", "/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl", "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl", "code", "code-insiders", "vscodium", "/Applications/AppCode.app/Contents/MacOS/appcode", "/Applications/CLion.app/Contents/MacOS/clion", "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea", "/Applications/PhpStorm.app/Contents/MacOS/phpstorm", "/Applications/PyCharm.app/Contents/MacOS/pycharm", "/Applications/PyCharm CE.app/Contents/MacOS/pycharm", "/Applications/RubyMine.app/Contents/MacOS/rubymine", "/Applications/WebStorm.app/Contents/MacOS/webstorm", "/Applications/GoLand.app/Contents/MacOS/goland", "/Applications/Rider.app/Contents/MacOS/rider", "mvim", "emacs", "gvim", "idea", "phpstorm", "pycharm", "rubymine", "sublime_text", "vim", "webstorm", "goland", "rider", "Brackets.exe", "Code.exe", "Code - Insiders.exe", "VSCodium.exe", "atom.exe", "sublime_text.exe", "notepad++.exe", "clion.exe", "clion64.exe", "idea.exe", "idea64.exe", "phpstorm.exe", "phpstorm64.exe", "pycharm.exe", "pycharm64.exe", "rubymine.exe", "rubymine64.exe", "webstorm.exe", "webstorm64.exe", "goland.exe", "goland64.exe", "rider.exe", "rider64.exe", "nano"];
|
|
4
2
|
export declare const getDisplayNameForEditor: (editor: Editor | undefined) => string | null;
|
|
5
3
|
declare type Editor = typeof editorNames[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-in-editor.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/open-in-editor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"open-in-editor.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/open-in-editor.ts"],"names":[],"mappings":"AA2CA,QAAA,MAAM,WAAW,8zCAwDP,CAAC;AA+DX,eAAO,MAAM,uBAAuB,WAC3B,MAAM,GAAG,SAAS,KACxB,MAAM,GAAG,IAMX,CAAC;AAEF,aAAK,MAAM,GAAG,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AA+JzC,wBAAsB,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAsErD;AAID,wBAAsB,YAAY,CAAC,EAClC,SAAS,EACT,MAAM,EACN,QAAQ,EACR,UAAU,EACV,eAAe,GACf,EAAE;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,OAAO,CAAC,CAmGnB"}
|
|
@@ -23,7 +23,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.launchEditor = exports.guessEditor = exports.getDisplayNameForEditor =
|
|
26
|
+
exports.launchEditor = exports.guessEditor = exports.getDisplayNameForEditor = void 0;
|
|
27
27
|
/*
|
|
28
28
|
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.
|
|
29
29
|
*/
|
|
@@ -47,7 +47,6 @@ const isVsCodeDerivative = (editor) => {
|
|
|
47
47
|
editor === 'VSCodium.exe' ||
|
|
48
48
|
editor === 'Code - Insiders.exe');
|
|
49
49
|
};
|
|
50
|
-
exports.isVsCodeDerivative = isVsCodeDerivative;
|
|
51
50
|
function isTerminalEditor(editor) {
|
|
52
51
|
switch (editor) {
|
|
53
52
|
case 'vim':
|
|
@@ -58,7 +57,6 @@ function isTerminalEditor(editor) {
|
|
|
58
57
|
return false;
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
|
-
exports.isTerminalEditor = isTerminalEditor;
|
|
62
60
|
const editorNames = [
|
|
63
61
|
'atom',
|
|
64
62
|
'/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',
|
|
@@ -417,7 +415,7 @@ async function launchEditor({ colNumber, editor, fileName, lineNumber, vsCodeNew
|
|
|
417
415
|
console.log();
|
|
418
416
|
return false;
|
|
419
417
|
}
|
|
420
|
-
const shouldOpenVsCodeNewWindow =
|
|
418
|
+
const shouldOpenVsCodeNewWindow = isVsCodeDerivative(editor) && vsCodeNewWindow;
|
|
421
419
|
const args = shouldOpenVsCodeNewWindow
|
|
422
420
|
? ['--new-window', fileName]
|
|
423
421
|
: lineNumber
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-in-editor.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/open-in-editor.ts"],"names":[],"mappings":";AAAA,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;AAEnD;;EAEE;AAEF;;;;;GAKG;AACH,gDAAwB;AAExB,4CAAoB;AACpB,gDAAwB;AACxB,+DAAgE;AAChE,4CAAoB;AAEpB,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"open-in-editor.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/open-in-editor.ts"],"names":[],"mappings":";AAAA,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;AAEnD;;EAEE;AAEF;;;;;GAKG;AACH,gDAAwB;AAExB,4CAAoB;AACpB,gDAAwB;AACxB,+DAAgE;AAChE,4CAAoB;AAEpB,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;AAEtC,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC7C,OAAO,CACN,MAAM,KAAK,MAAM;QACjB,MAAM,KAAK,eAAe;QAC1B,MAAM,KAAK,UAAU;QACrB,MAAM,KAAK,UAAU;QACrB,MAAM,KAAK,cAAc;QACzB,MAAM,KAAK,qBAAqB,CAChC,CAAC;AACH,CAAC,CAAC;AAEF,SAAS,gBAAgB,CAAC,MAAc;IACvC,QAAQ,MAAM,EAAE;QACf,KAAK,KAAK,CAAC;QACX,KAAK,OAAO,CAAC;Q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AC;IAEd,IAAI,aAAa,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE;QAC9C,+DAA+D;QAC/D,gEAAgE;QAChE,6DAA6D;QAC7D,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC9B;IAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QACjC,kEAAkE;QAClE,qBAAqB;QACrB,aAAa,GAAG,uBAAa,CAAC,KAAK,CAClC,SAAS,EACT,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAC3B,EAAC,KAAK,EAAE,SAAS,EAAC,CAClB,CAAC;KACF;SAAM;QACN,aAAa,GAAG,uBAAa,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,EAAC,KAAK,EAAE,SAAS,EAAC,CAAC,CAAC;KACtE;IAED,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE;QACtC,aAAa,GAAG,IAAI,CAAC;QAErB,IAAI,SAAS,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,4BAA4B,SAAS,EAAE,CAAC,CAAC;SACrD;IACF,CAAC,CAAC,CAAC;IAEH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QACnC,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC;AA/GD,oCA+GC"}
|
|
@@ -1,15 +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 as parse };
|
|
14
|
-
export default parseError;
|
|
1
|
+
import { SomeStackFrame } from './stack-frame';
|
|
2
|
+
export declare const parseError: (error: Error | string | string[], contextLines: number) => Promise<SomeStackFrame[]>;
|
|
15
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"}
|
|
@@ -3,13 +3,15 @@
|
|
|
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.
|
|
6
|
+
exports.parseError = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
9
9
|
*
|
|
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,29 +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
|
-
}
|
|
83
|
-
exports.
|
|
84
|
-
exports.default = parseError;
|
|
116
|
+
};
|
|
117
|
+
exports.parseError = parseError;
|
|
85
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,I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AAK,KAAK,IAAI,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;KAClD;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9B,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAkB,EAAE;YAClE,OAAO;gBACN,IAAI,EAAE,YAAY;gBAClB,KAAK;aACL,CAAC;QACH,CAAC,CAAC,CAAC;KACH;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACzB,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAkB,EAAE;YACtD,OAAO;gBACN,IAAI,EAAE,YAAY;gBAClB,KAAK;aACL,CAAC;QACH,CAAC,CAAC,CAAC;KACH;IAED,MAAM,aAAa,GAAG,IAAA,oDAAyB,EAAC,KAAK,CAAC,CAAC;IAEvD,IAAI,aAAa,EAAE;QAClB,OAAO;YACN;gBACC,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,MAAM,IAAA,uCAAiB,EAAC,aAAa,EAAE,YAAY,CAAC;aAC3D;SACD,CAAC;KACF;IAED,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;QACpC,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,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,43 +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 name of this function.
|
|
34
|
-
*/
|
|
35
|
-
getFunctionName(): string;
|
|
36
|
-
/**
|
|
37
|
-
* Returns the source of the frame.
|
|
38
|
-
* This contains the file name, line number, and column number when available.
|
|
39
|
-
*/
|
|
40
|
-
getSource(): string;
|
|
41
|
-
/**
|
|
42
|
-
* Returns a pretty version of this stack frame.
|
|
43
|
-
*/
|
|
44
|
-
toString(): string;
|
|
45
|
-
}
|
|
37
|
+
fileName: string;
|
|
38
|
+
lineNumber: number;
|
|
39
|
+
columnNumber: number;
|
|
40
|
+
}) => StackFrame;
|
|
46
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,83 +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;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Returns the name of this function.
|
|
54
|
-
*/
|
|
55
|
-
getFunctionName() {
|
|
56
|
-
return this.functionName || '(anonymous function)';
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Returns the source of the frame.
|
|
60
|
-
* This contains the file name, line number, and column number when available.
|
|
61
|
-
*/
|
|
62
|
-
getSource() {
|
|
63
|
-
let str = '';
|
|
64
|
-
if (this.fileName !== null) {
|
|
65
|
-
str += this.fileName + ':';
|
|
66
|
-
}
|
|
67
|
-
if (this.lineNumber !== null) {
|
|
68
|
-
str += this.lineNumber + ':';
|
|
69
|
-
}
|
|
70
|
-
if (this.columnNumber !== null) {
|
|
71
|
-
str += this.columnNumber + ':';
|
|
72
|
-
}
|
|
73
|
-
return str.slice(0, -1);
|
|
10
|
+
const makeStackFrame = ({ functionName, fileName, lineNumber, columnNumber, }) => {
|
|
11
|
+
if (functionName && functionName.indexOf('Object.') === 0) {
|
|
12
|
+
functionName = functionName.slice('Object.'.length);
|
|
74
13
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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;
|
|
82
23
|
}
|
|
83
|
-
|
|
84
|
-
|
|
24
|
+
return {
|
|
25
|
+
columnNumber,
|
|
26
|
+
fileName,
|
|
27
|
+
functionName,
|
|
28
|
+
lineNumber,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.makeStackFrame = makeStackFrame;
|
|
85
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,14 +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 };
|
|
13
|
-
export default unmap;
|
|
1
|
+
import { SomeStackFrame, SymbolicatedStackFrame } from './stack-frame';
|
|
2
|
+
export declare const unmap: (frames: SomeStackFrame[], contextLines: number) => Promise<SymbolicatedStackFrame[]>;
|
|
14
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"}
|