@remotion/bundler 3.0.0-lambda.288 → 3.0.0-lambda.295
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/bundler.d.ts.map +1 -1
- package/dist/bundler.js +29 -11
- package/dist/bundler.js.map +1 -1
- package/dist/dev-middleware/compatible-api.d.ts +10 -0
- package/dist/dev-middleware/compatible-api.d.ts.map +1 -0
- package/dist/dev-middleware/compatible-api.js +45 -0
- package/dist/dev-middleware/compatible-api.js.map +1 -0
- package/dist/dev-middleware/get-filename-from-url.d.ts +3 -0
- package/dist/dev-middleware/get-filename-from-url.d.ts.map +1 -0
- package/dist/dev-middleware/get-filename-from-url.js +93 -0
- package/dist/dev-middleware/get-filename-from-url.js.map +1 -0
- package/dist/dev-middleware/get-paths.d.ts +8 -0
- package/dist/dev-middleware/get-paths.d.ts.map +1 -0
- package/dist/dev-middleware/get-paths.js +20 -0
- package/dist/dev-middleware/get-paths.js.map +1 -0
- package/dist/dev-middleware/index.d.ts +3 -0
- package/dist/dev-middleware/index.d.ts.map +1 -0
- package/dist/dev-middleware/index.js +58 -0
- package/dist/dev-middleware/index.js.map +1 -0
- package/dist/dev-middleware/is-color-supported.d.ts +2 -0
- package/dist/dev-middleware/is-color-supported.d.ts.map +1 -0
- package/dist/dev-middleware/is-color-supported.js +34 -0
- package/dist/dev-middleware/is-color-supported.js.map +1 -0
- package/dist/dev-middleware/middleware.d.ts +4 -0
- package/dist/dev-middleware/middleware.d.ts.map +1 -0
- package/dist/dev-middleware/middleware.js +142 -0
- package/dist/dev-middleware/middleware.js.map +1 -0
- package/dist/dev-middleware/range-parser.d.ts +16 -0
- package/dist/dev-middleware/range-parser.d.ts.map +1 -0
- package/dist/dev-middleware/range-parser.js +97 -0
- package/dist/dev-middleware/range-parser.js.map +1 -0
- package/dist/dev-middleware/ready.d.ts +6 -0
- package/dist/dev-middleware/ready.d.ts.map +1 -0
- package/dist/dev-middleware/ready.js +14 -0
- package/dist/dev-middleware/ready.js.map +1 -0
- package/dist/dev-middleware/setup-hooks.d.ts +3 -0
- package/dist/dev-middleware/setup-hooks.d.ts.map +1 -0
- package/dist/dev-middleware/setup-hooks.js +45 -0
- package/dist/dev-middleware/setup-hooks.js.map +1 -0
- package/dist/dev-middleware/setup-output-filesystem.d.ts +3 -0
- package/dist/dev-middleware/setup-output-filesystem.d.ts.map +1 -0
- package/dist/dev-middleware/setup-output-filesystem.js +14 -0
- package/dist/dev-middleware/setup-output-filesystem.js.map +1 -0
- package/dist/dev-middleware/types.d.ts +12 -0
- package/dist/dev-middleware/types.d.ts.map +1 -0
- package/dist/dev-middleware/types.js +3 -0
- package/dist/dev-middleware/types.js.map +1 -0
- package/dist/error-overlay/entry-basic.d.ts +2 -0
- package/dist/error-overlay/entry-basic.d.ts.map +1 -0
- package/dist/error-overlay/entry-basic.js +25 -0
- package/dist/error-overlay/entry-basic.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/format-warning.d.ts +12 -0
- package/dist/error-overlay/react-overlay/effects/format-warning.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/format-warning.js +42 -0
- package/dist/error-overlay/react-overlay/effects/format-warning.js.map +1 -0
- 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 +36 -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 +25 -0
- package/dist/error-overlay/react-overlay/effects/proxy-console.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/proxy-console.js +65 -0
- package/dist/error-overlay/react-overlay/effects/proxy-console.js.map +1 -0
- 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 +38 -0
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/stack-trace-limit.d.ts +4 -0
- package/dist/error-overlay/react-overlay/effects/stack-trace-limit.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/stack-trace-limit.js +44 -0
- package/dist/error-overlay/react-overlay/effects/stack-trace-limit.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-error.d.ts +5 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-error.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-error.js +46 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-error.js.map +1 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-rejection.d.ts +5 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-rejection.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-rejection.js +42 -0
- package/dist/error-overlay/react-overlay/effects/unhandled-rejection.js.map +1 -0
- package/dist/error-overlay/react-overlay/index.d.ts +9 -0
- package/dist/error-overlay/react-overlay/index.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/index.js +49 -0
- package/dist/error-overlay/react-overlay/index.js.map +1 -0
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts +10 -0
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +73 -0
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js.map +1 -0
- 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 +15 -0
- package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-lines-around.js +31 -0
- package/dist/error-overlay/react-overlay/utils/get-lines-around.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts +50 -0
- package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-source-map.js +105 -0
- package/dist/error-overlay/react-overlay/utils/get-source-map.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts +16 -0
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.js +43 -0
- package/dist/error-overlay/react-overlay/utils/get-stack-frames.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/mapper.d.ts +16 -0
- package/dist/error-overlay/react-overlay/utils/mapper.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/mapper.js +61 -0
- package/dist/error-overlay/react-overlay/utils/mapper.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/open-in-editor.d.ts +13 -0
- package/dist/error-overlay/react-overlay/utils/open-in-editor.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/open-in-editor.js +450 -0
- package/dist/error-overlay/react-overlay/utils/open-in-editor.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/parser.d.ts +14 -0
- package/dist/error-overlay/react-overlay/utils/parser.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/parser.js +84 -0
- package/dist/error-overlay/react-overlay/utils/parser.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/path.d.ts +2 -0
- package/dist/error-overlay/react-overlay/utils/path.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/path.js +98 -0
- package/dist/error-overlay/react-overlay/utils/path.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/settle-promise.d.ts +3 -0
- package/dist/error-overlay/react-overlay/utils/settle-promise.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/settle-promise.js +20 -0
- package/dist/error-overlay/react-overlay/utils/settle-promise.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts +38 -0
- package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/stack-frame.js +71 -0
- package/dist/error-overlay/react-overlay/utils/stack-frame.js.map +1 -0
- package/dist/error-overlay/react-overlay/utils/unmapper.d.ts +13 -0
- package/dist/error-overlay/react-overlay/utils/unmapper.d.ts.map +1 -0
- package/dist/error-overlay/react-overlay/utils/unmapper.js +93 -0
- package/dist/error-overlay/react-overlay/utils/unmapper.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/AskOnDiscord.d.ts +3 -0
- package/dist/error-overlay/remotion-overlay/AskOnDiscord.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/AskOnDiscord.js +15 -0
- package/dist/error-overlay/remotion-overlay/AskOnDiscord.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/Button.d.ts +6 -0
- package/dist/error-overlay/remotion-overlay/Button.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/Button.js +25 -0
- package/dist/error-overlay/remotion-overlay/Button.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.d.ts +7 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +29 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/DismissButton.d.ts +3 -0
- package/dist/error-overlay/remotion-overlay/DismissButton.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/DismissButton.js +24 -0
- package/dist/error-overlay/remotion-overlay/DismissButton.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts +6 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +80 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +6 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +92 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/Overlay.d.ts +17 -0
- package/dist/error-overlay/remotion-overlay/Overlay.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/Overlay.js +35 -0
- package/dist/error-overlay/remotion-overlay/Overlay.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.d.ts +5 -0
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +14 -0
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +9 -0
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/StackFrame.js +44 -0
- package/dist/error-overlay/remotion-overlay/StackFrame.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/carets.d.ts +3 -0
- package/dist/error-overlay/remotion-overlay/carets.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/carets.js +13 -0
- package/dist/error-overlay/remotion-overlay/carets.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/format-location.d.ts +2 -0
- package/dist/error-overlay/remotion-overlay/format-location.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/format-location.js +11 -0
- package/dist/error-overlay/remotion-overlay/format-location.js.map +1 -0
- package/dist/error-overlay/remotion-overlay/index.d.ts +2 -0
- package/dist/error-overlay/remotion-overlay/index.d.ts.map +1 -0
- package/dist/error-overlay/remotion-overlay/index.js +14 -0
- package/dist/error-overlay/remotion-overlay/index.js.map +1 -0
- package/dist/fast-refresh/helpers.d.ts +15 -7
- package/dist/fast-refresh/helpers.d.ts.map +1 -1
- package/dist/fast-refresh/helpers.js +33 -25
- package/dist/fast-refresh/helpers.js.map +1 -1
- package/dist/fast-refresh/{fast-refresh.d.ts → index.d.ts} +4 -1
- package/dist/fast-refresh/index.d.ts.map +1 -0
- package/dist/fast-refresh/index.js +60 -0
- package/dist/fast-refresh/index.js.map +1 -0
- package/dist/fast-refresh/loader.d.ts +12 -2
- package/dist/fast-refresh/loader.d.ts.map +1 -1
- package/dist/fast-refresh/loader.js +13 -37
- package/dist/fast-refresh/loader.js.map +1 -1
- package/dist/fast-refresh/runtime.d.ts +12 -2
- package/dist/fast-refresh/runtime.d.ts.map +1 -1
- package/dist/fast-refresh/runtime.js +8 -27
- package/dist/fast-refresh/runtime.js.map +1 -1
- package/dist/hot-middleware/client.d.ts +20 -0
- package/dist/hot-middleware/client.d.ts.map +1 -0
- package/dist/hot-middleware/client.js +208 -0
- package/dist/hot-middleware/client.js.map +1 -0
- package/dist/hot-middleware/index.d.ts +14 -0
- package/dist/hot-middleware/index.d.ts.map +1 -0
- package/dist/hot-middleware/index.js +181 -0
- package/dist/hot-middleware/index.js.map +1 -0
- package/dist/hot-middleware/process-update.d.ts +13 -0
- package/dist/hot-middleware/process-update.d.ts.map +1 -0
- package/dist/hot-middleware/process-update.js +149 -0
- package/dist/hot-middleware/process-update.js.map +1 -0
- package/dist/hot-middleware/strip-ansi.d.ts +2 -0
- package/dist/hot-middleware/strip-ansi.d.ts.map +1 -0
- package/dist/hot-middleware/strip-ansi.js +22 -0
- package/dist/hot-middleware/strip-ansi.js.map +1 -0
- package/dist/hot-middleware/types.d.ts +39 -0
- package/dist/hot-middleware/types.d.ts.map +1 -0
- package/dist/hot-middleware/types.js +18 -0
- package/dist/hot-middleware/types.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/renderEntry.js +2 -2
- package/dist/renderEntry.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 +0 -1
- package/dist/start-server.d.ts.map +1 -1
- package/dist/start-server.js +58 -14
- package/dist/start-server.js.map +1 -1
- package/dist/static-preview.d.ts +1 -1
- package/dist/static-preview.d.ts.map +1 -1
- package/dist/static-preview.js +8 -2
- package/dist/static-preview.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/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/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 +1 -1
- package/dist/update-available.d.ts.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/dist/webpack-config.d.ts +1 -2
- package/dist/webpack-config.d.ts.map +1 -1
- package/dist/webpack-config.js +14 -11
- package/dist/webpack-config.js.map +1 -1
- package/package.json +12 -8
- package/dist/env-variables.d.ts +0 -2
- package/dist/env-variables.d.ts.map +0 -1
- package/dist/env-variables.js +0 -5
- package/dist/env-variables.js.map +0 -1
- package/dist/fast-refresh/error-overlay/entry-basic.d.ts +0 -3
- package/dist/fast-refresh/error-overlay/entry-basic.d.ts.map +0 -1
- package/dist/fast-refresh/error-overlay/entry-basic.js +0 -27
- package/dist/fast-refresh/error-overlay/entry-basic.js.map +0 -1
- package/dist/fast-refresh/error-overlay/entry-devserver.d.ts +0 -8
- package/dist/fast-refresh/error-overlay/entry-devserver.d.ts.map +0 -1
- package/dist/fast-refresh/error-overlay/entry-devserver.js +0 -36
- package/dist/fast-refresh/error-overlay/entry-devserver.js.map +0 -1
- package/dist/fast-refresh/error-overlay/index.d.ts +0 -7
- package/dist/fast-refresh/error-overlay/index.d.ts.map +0 -1
- package/dist/fast-refresh/error-overlay/index.js +0 -92
- package/dist/fast-refresh/error-overlay/index.js.map +0 -1
- package/dist/fast-refresh/fast-refresh.d.ts.map +0 -1
- package/dist/fast-refresh/fast-refresh.js +0 -98
- package/dist/fast-refresh/fast-refresh.js.map +0 -1
- package/dist/hot-middleware.d.ts +0 -28
- package/dist/hot-middleware.d.ts.map +0 -1
- package/dist/hot-middleware.js +0 -119
- package/dist/hot-middleware.js.map +0 -1
- package/dist/setup-env-variables.d.ts +0 -2
- package/dist/setup-env-variables.d.ts.map +0 -1
- package/dist/setup-env-variables.js +0 -5
- package/dist/setup-env-variables.js.map +0 -1
- package/web/index.html +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unhandled-error.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/unhandled-error.ts"],"names":[],"mappings":"AAaA,aAAK,aAAa,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AAmB5C,iBAAS,sBAAsB,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,QAU3E;AAED,iBAAS,wBAAwB,CAAC,MAAM,EAAE,WAAW,QAOpD;AAED,OAAO,EACN,sBAAsB,IAAI,QAAQ,EAClC,wBAAwB,IAAI,UAAU,GACtC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
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
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.unregister = exports.register = 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
|
+
let boundErrorHandler = null;
|
|
14
|
+
function errorHandler(callback, e) {
|
|
15
|
+
// @ts-expect-error
|
|
16
|
+
if (!e.error) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// @ts-expect-error
|
|
20
|
+
const { error } = e;
|
|
21
|
+
if (error instanceof Error) {
|
|
22
|
+
callback(error);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
// A non-error was thrown, we don't have a trace. :(
|
|
26
|
+
// Look in your browser's devtools for more information
|
|
27
|
+
callback(new Error(error));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function registerUnhandledError(target, callback) {
|
|
31
|
+
if (boundErrorHandler !== null) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
boundErrorHandler = errorHandler.bind(undefined, callback);
|
|
35
|
+
target.addEventListener('error', boundErrorHandler);
|
|
36
|
+
}
|
|
37
|
+
exports.register = registerUnhandledError;
|
|
38
|
+
function unregisterUnhandledError(target) {
|
|
39
|
+
if (boundErrorHandler === null) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
target.removeEventListener('error', boundErrorHandler);
|
|
43
|
+
boundErrorHandler = null;
|
|
44
|
+
}
|
|
45
|
+
exports.unregister = unregisterUnhandledError;
|
|
46
|
+
//# sourceMappingURL=unhandled-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unhandled-error.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/unhandled-error.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF;;;;;GAKG;AAEH,IAAI,iBAAiB,GAA+B,IAAI,CAAC;AAIzD,SAAS,YAAY,CAAC,QAAuB,EAAE,CAAQ;IACtD,mBAAmB;IACnB,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;QACb,OAAO;KACP;IAED,mBAAmB;IACnB,MAAM,EAAC,KAAK,EAAC,GAAG,CAAC,CAAC;IAClB,IAAI,KAAK,YAAY,KAAK,EAAE;QAC3B,QAAQ,CAAC,KAAK,CAAC,CAAC;KAChB;SAAM;QACN,oDAAoD;QACpD,uDAAuD;QACvD,QAAQ,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;KAC3B;AACF,CAAC;AAED,SAAS,sBAAsB,CAAC,MAAmB,EAAE,QAAuB;IAC3E,IAAI,iBAAiB,KAAK,IAAI,EAAE;QAC/B,OAAO;KACP;IAED,iBAAiB,GAAG,YAAY,CAAC,IAAI,CACpC,SAAS,EACT,QAAQ,CAC0B,CAAC;IACpC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;AACrD,CAAC;AAY0B,0CAAQ;AAVnC,SAAS,wBAAwB,CAAC,MAAmB;IACpD,IAAI,iBAAiB,KAAK,IAAI,EAAE;QAC/B,OAAO;KACP;IAED,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IACvD,iBAAiB,GAAG,IAAI,CAAC;AAC1B,CAAC;AAI4B,8CAAU"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare type ErrorCallback = (error: Error) => void;
|
|
2
|
+
declare function registerUnhandledRejection(target: EventTarget, callback: ErrorCallback): void;
|
|
3
|
+
declare function unregisterUnhandledRejection(target: EventTarget): void;
|
|
4
|
+
export { registerUnhandledRejection as register, unregisterUnhandledRejection as unregister, };
|
|
5
|
+
//# sourceMappingURL=unhandled-rejection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unhandled-rejection.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/unhandled-rejection.ts"],"names":[],"mappings":"AAaA,aAAK,aAAa,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AAoB5C,iBAAS,0BAA0B,CAClC,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,aAAa,QAWvB;AAED,iBAAS,4BAA4B,CAAC,MAAM,EAAE,WAAW,QAOxD;AAED,OAAO,EACN,0BAA0B,IAAI,QAAQ,EACtC,4BAA4B,IAAI,UAAU,GAC1C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
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
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.unregister = exports.register = 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
|
+
let boundRejectionHandler = null;
|
|
14
|
+
function rejectionHandler(callback, e) {
|
|
15
|
+
if (!(e === null || e === void 0 ? void 0 : e.reason)) {
|
|
16
|
+
return callback(new Error('Unknown'));
|
|
17
|
+
}
|
|
18
|
+
const { reason } = e;
|
|
19
|
+
if (reason instanceof Error) {
|
|
20
|
+
return callback(reason);
|
|
21
|
+
}
|
|
22
|
+
// A non-error was rejected, we don't have a trace :(
|
|
23
|
+
// Look in your browser's devtools for more information
|
|
24
|
+
return callback(new Error(reason));
|
|
25
|
+
}
|
|
26
|
+
function registerUnhandledRejection(target, callback) {
|
|
27
|
+
if (boundRejectionHandler !== null) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
boundRejectionHandler = rejectionHandler.bind(undefined, callback);
|
|
31
|
+
target.addEventListener('unhandledrejection', boundRejectionHandler);
|
|
32
|
+
}
|
|
33
|
+
exports.register = registerUnhandledRejection;
|
|
34
|
+
function unregisterUnhandledRejection(target) {
|
|
35
|
+
if (boundRejectionHandler === null) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
target.removeEventListener('unhandledrejection', boundRejectionHandler);
|
|
39
|
+
boundRejectionHandler = null;
|
|
40
|
+
}
|
|
41
|
+
exports.unregister = unregisterUnhandledRejection;
|
|
42
|
+
//# sourceMappingURL=unhandled-rejection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unhandled-rejection.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/effects/unhandled-rejection.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF;;;;;GAKG;AAEH,IAAI,qBAAqB,GAAyB,IAAI,CAAC;AAIvD,SAAS,gBAAgB,CACxB,QAAuB,EACvB,CAAwB;IAExB,IAAI,CAAC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,MAAM,CAAA,EAAE;QACf,OAAO,QAAQ,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;KACtC;IAED,MAAM,EAAC,MAAM,EAAC,GAAG,CAAC,CAAC;IACnB,IAAI,MAAM,YAAY,KAAK,EAAE;QAC5B,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;KACxB;IAED,qDAAqD;IACrD,uDAAuD;IACvD,OAAO,QAAQ,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,0BAA0B,CAClC,MAAmB,EACnB,QAAuB;IAEvB,IAAI,qBAAqB,KAAK,IAAI,EAAE;QACnC,OAAO;KACP;IAED,qBAAqB,GAAG,gBAAgB,CAAC,IAAI,CAC5C,SAAS,EACT,QAAQ,CACoB,CAAC;IAC9B,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,qBAAqB,CAAC,CAAC;AACtE,CAAC;AAY8B,8CAAQ;AAVvC,SAAS,4BAA4B,CAAC,MAAmB;IACxD,IAAI,qBAAqB,KAAK,IAAI,EAAE;QACnC,OAAO;KACP;IAED,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,qBAAqB,CAAC,CAAC;IACxE,qBAAqB,GAAG,IAAI,CAAC;AAC9B,CAAC;AAIgC,kDAAU"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare type RuntimeReportingOptions = {
|
|
2
|
+
onError: () => void;
|
|
3
|
+
filename?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const dismissErrors: () => void;
|
|
6
|
+
export declare const shouldReload: () => boolean;
|
|
7
|
+
export declare function startReportingRuntimeErrors(options: RuntimeReportingOptions): void;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/index.ts"],"names":[],"mappings":"AAIA,aAAK,uBAAuB,GAAG;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,eAAO,MAAM,aAAa,YAEzB,CAAC;AAEF,eAAO,MAAM,YAAY,eAExB,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,uBAAuB,QAuC3E"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startReportingRuntimeErrors = exports.shouldReload = exports.dismissErrors = void 0;
|
|
4
|
+
const Overlay_1 = require("../remotion-overlay/Overlay");
|
|
5
|
+
const listen_to_runtime_errors_1 = require("./listen-to-runtime-errors");
|
|
6
|
+
let stopListeningToRuntimeErrors = null;
|
|
7
|
+
let currentRuntimeErrorRecords = [];
|
|
8
|
+
const dismissErrors = () => {
|
|
9
|
+
currentRuntimeErrorRecords = [];
|
|
10
|
+
};
|
|
11
|
+
exports.dismissErrors = dismissErrors;
|
|
12
|
+
const shouldReload = () => {
|
|
13
|
+
return currentRuntimeErrorRecords.some((e) => e.type === 'syntax');
|
|
14
|
+
};
|
|
15
|
+
exports.shouldReload = shouldReload;
|
|
16
|
+
function startReportingRuntimeErrors(options) {
|
|
17
|
+
if (stopListeningToRuntimeErrors !== null) {
|
|
18
|
+
throw new Error('Already listening');
|
|
19
|
+
}
|
|
20
|
+
const handleRuntimeError = (opts) => (errorRecord) => {
|
|
21
|
+
try {
|
|
22
|
+
if (typeof opts.onError === 'function') {
|
|
23
|
+
opts.onError.call(null);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
if (currentRuntimeErrorRecords.some(({ error }) => error === errorRecord.error)) {
|
|
28
|
+
// Deduplicate identical errors.
|
|
29
|
+
// This fixes https://github.com/facebook/create-react-app/issues/3011.
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
currentRuntimeErrorRecords = currentRuntimeErrorRecords.concat([
|
|
33
|
+
errorRecord,
|
|
34
|
+
]);
|
|
35
|
+
update();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
function update() {
|
|
40
|
+
var _a;
|
|
41
|
+
(_a = Overlay_1.setErrorsRef.current) === null || _a === void 0 ? void 0 : _a.setErrors({
|
|
42
|
+
type: 'errors',
|
|
43
|
+
errors: currentRuntimeErrorRecords,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
stopListeningToRuntimeErrors = (0, listen_to_runtime_errors_1.listenToRuntimeErrors)(handleRuntimeError(options), options.filename);
|
|
47
|
+
}
|
|
48
|
+
exports.startReportingRuntimeErrors = startReportingRuntimeErrors;
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/index.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,yEAA8E;AAE9E,IAAI,4BAA4B,GAAwB,IAAI,CAAC;AAM7D,IAAI,0BAA0B,GAAkB,EAAE,CAAC;AAE5C,MAAM,aAAa,GAAG,GAAG,EAAE;IACjC,0BAA0B,GAAG,EAAE,CAAC;AACjC,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEK,MAAM,YAAY,GAAG,GAAG,EAAE;IAChC,OAAO,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;AACpE,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF,SAAgB,2BAA2B,CAAC,OAAgC;IAC3E,IAAI,4BAA4B,KAAK,IAAI,EAAE;QAC1C,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACrC;IAED,MAAM,kBAAkB,GACvB,CAAC,IAA6B,EAAE,EAAE,CAAC,CAAC,WAAwB,EAAE,EAAE;QAC/D,IAAI;YACH,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE;gBACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACxB;SACD;gBAAS;YACT,IACC,0BAA0B,CAAC,IAAI,CAC9B,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,KAAK,KAAK,WAAW,CAAC,KAAK,CACxC,EACA;gBACD,gCAAgC;gBAChC,uEAAuE;aACvE;iBAAM;gBACN,0BAA0B,GAAG,0BAA0B,CAAC,MAAM,CAAC;oBAC9D,WAAW;iBACX,CAAC,CAAC;gBACH,MAAM,EAAE,CAAC;aACT;SACD;IACF,CAAC,CAAC;IAEH,SAAS,MAAM;;QACd,MAAA,sBAAY,CAAC,OAAO,0CAAE,SAAS,CAAC;YAC/B,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,0BAA0B;SAClC,CAAC,CAAC;IACJ,CAAC;IAED,4BAA4B,GAAG,IAAA,gDAAqB,EACnD,kBAAkB,CAAC,OAAO,CAAC,EAC3B,OAAO,CAAC,QAAkB,CAC1B,CAAC;AACH,CAAC;AAvCD,kEAuCC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StackFrame } from './utils/stack-frame';
|
|
2
|
+
export declare type ErrorRecord = {
|
|
3
|
+
error: Error;
|
|
4
|
+
unhandledRejection: boolean;
|
|
5
|
+
contextSize: number;
|
|
6
|
+
stackFrames: StackFrame[];
|
|
7
|
+
type: 'exception' | 'syntax';
|
|
8
|
+
};
|
|
9
|
+
export declare function listenToRuntimeErrors(crash: (rec: ErrorRecord) => void, filename: string): () => void;
|
|
10
|
+
//# sourceMappingURL=listen-to-runtime-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listen-to-runtime-errors.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/listen-to-runtime-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,oBAAY,WAAW,GAAG;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,IAAI,EAAE,WAAW,GAAG,QAAQ,CAAC;CAC7B,CAAC;AAkEF,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,EACjC,QAAQ,EAAE,MAAM,cAsChB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listenToRuntimeErrors = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
const unhandled_error_1 = require("./effects/unhandled-error");
|
|
11
|
+
const unhandled_rejection_1 = require("./effects/unhandled-rejection");
|
|
12
|
+
const stack_trace_limit_1 = require("./effects/stack-trace-limit");
|
|
13
|
+
const proxy_console_1 = require("./effects/proxy-console");
|
|
14
|
+
const format_warning_1 = require("./effects/format-warning");
|
|
15
|
+
const get_stack_frames_1 = require("./utils/get-stack-frames");
|
|
16
|
+
const Overlay_1 = require("../remotion-overlay/Overlay");
|
|
17
|
+
const CONTEXT_SIZE = 3;
|
|
18
|
+
const crashWithFrames = (crash) => async (error, unhandledRejection) => {
|
|
19
|
+
var _a;
|
|
20
|
+
try {
|
|
21
|
+
(_a = Overlay_1.setErrorsRef.current) === null || _a === void 0 ? void 0 : _a.setErrors({
|
|
22
|
+
type: 'symbolicating',
|
|
23
|
+
});
|
|
24
|
+
const { frames: stackFrames, type } = await (0, get_stack_frames_1.getStackFrames)(error, CONTEXT_SIZE);
|
|
25
|
+
if (stackFrames === null || stackFrames === undefined) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
crash({
|
|
29
|
+
error,
|
|
30
|
+
unhandledRejection,
|
|
31
|
+
contextSize: CONTEXT_SIZE,
|
|
32
|
+
stackFrames,
|
|
33
|
+
type,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
console.log('Could not get the stack frames of error:', e);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function listenToRuntimeErrors(crash, filename) {
|
|
41
|
+
const crashWithFramesRunTime = crashWithFrames(crash);
|
|
42
|
+
(0, unhandled_error_1.register)(window, (error) => {
|
|
43
|
+
return crashWithFramesRunTime(error, false);
|
|
44
|
+
});
|
|
45
|
+
(0, unhandled_rejection_1.register)(window, (error) => {
|
|
46
|
+
return crashWithFramesRunTime(error, true);
|
|
47
|
+
});
|
|
48
|
+
(0, stack_trace_limit_1.register)();
|
|
49
|
+
(0, proxy_console_1.registerReactStack)();
|
|
50
|
+
(0, proxy_console_1.permanentRegister)('error', (d) => {
|
|
51
|
+
if (d.type === 'webpack-error') {
|
|
52
|
+
const { message, frames } = d;
|
|
53
|
+
const data = (0, format_warning_1.massageWarning)(message, frames);
|
|
54
|
+
crashWithFramesRunTime({
|
|
55
|
+
message: data.message,
|
|
56
|
+
stack: data.stack,
|
|
57
|
+
__unmap_source: filename,
|
|
58
|
+
name: '',
|
|
59
|
+
}, false);
|
|
60
|
+
}
|
|
61
|
+
if (d.type === 'build-error') {
|
|
62
|
+
crashWithFramesRunTime(d.error, false);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return function () {
|
|
66
|
+
(0, stack_trace_limit_1.unregister)();
|
|
67
|
+
(0, unhandled_rejection_1.unregister)(window);
|
|
68
|
+
(0, unhandled_error_1.unregister)(window);
|
|
69
|
+
(0, proxy_console_1.unregisterReactStack)();
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
exports.listenToRuntimeErrors = listenToRuntimeErrors;
|
|
73
|
+
//# sourceMappingURL=listen-to-runtime-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listen-to-runtime-errors.js","sourceRoot":"","sources":["../../../src/error-overlay/react-overlay/listen-to-runtime-errors.ts"],"names":[],"mappings":";;;AAUA;;;;;GAKG;AAEH,+DAGmC;AACnC,uEAGuC;AACvC,mEAGqC;AACrC,2DAIiC;AACjC,6DAAwD;AACxD,+DAAwD;AACxD,yDAAyD;AAEzD,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,MAAM,eAAe,GACpB,CAAC,KAAiC,EAAE,EAAE,CACtC,KAAK,EACJ,KAEC,EACD,kBAA2B,EAC1B,EAAE;;IACH,IAAI;QACH,MAAA,sBAAY,CAAC,OAAO,0CAAE,SAAS,CAAC;YAC/B,IAAI,EAAE,eAAe;SACrB,CAAC,CAAC;QAEH,MAAM,EAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAC,GAAG,MAAM,IAAA,iCAAc,EACvD,KAAK,EACL,YAAY,CACZ,CAAC;QAEF,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE;YACtD,OAAO;SACP;QAED,KAAK,CAAC;YACL,KAAK;YACL,kBAAkB;YAClB,WAAW,EAAE,YAAY;YACzB,WAAW;YACX,IAAI;SACJ,CAAC,CAAC;KACH;IAAC,OAAO,CAAC,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,0CAA0C,EAAE,CAAC,CAAC,CAAC;KAC3D;AACF,CAAC,CAAC;AAEH,SAAgB,qBAAqB,CACpC,KAAiC,EACjC,QAAgB;IAEhB,MAAM,sBAAsB,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAEtD,IAAA,0BAAa,EAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;QAC/B,OAAO,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,IAAA,8BAAe,EAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;QACjC,OAAO,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IACH,IAAA,4BAAuB,GAAE,CAAC;IAC1B,IAAA,kCAAkB,GAAE,CAAC;IACrB,IAAA,iCAAwB,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;QACvC,IAAI,CAAC,CAAC,IAAI,KAAK,eAAe,EAAE;YAC/B,MAAM,EAAC,OAAO,EAAE,MAAM,EAAC,GAAG,CAAC,CAAC;YAC5B,MAAM,IAAI,GAAG,IAAA,+BAAc,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC7C,sBAAsB,CACrB;gBACC,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,cAAc,EAAE,QAAQ;gBACxB,IAAI,EAAE,EAAE;aACR,EACD,KAAK,CACL,CAAC;SACF;QAED,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,EAAE;YAC7B,sBAAsB,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SACvC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO;QACN,IAAA,8BAAyB,GAAE,CAAC;QAC5B,IAAA,gCAAiB,EAAC,MAAM,CAAC,CAAC;QAC1B,IAAA,4BAAe,EAAC,MAAM,CAAC,CAAC;QACxB,IAAA,oCAAoB,GAAE,CAAC;IACxB,CAAC,CAAC;AACH,CAAC;AAxCD,sDAwCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file-source.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-file-source.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,MAAO,MAAM,KAAG,QAAQ,MAAM,CAYvD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getFileSource = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const allowedFileExtensions = ['js', 'ts', 'tsx', 'jsx', 'map', 'mjs'];
|
|
10
|
+
const getFileSource = (p) => {
|
|
11
|
+
if (!allowedFileExtensions.find((extension) => p.endsWith(extension))) {
|
|
12
|
+
throw new Error(`Not allowed to open ${p}`);
|
|
13
|
+
}
|
|
14
|
+
const resolved = path_1.default.resolve(process.cwd(), p);
|
|
15
|
+
const relativeToProcessCwd = path_1.default.relative(process.cwd(), resolved);
|
|
16
|
+
if (relativeToProcessCwd.startsWith('..')) {
|
|
17
|
+
throw new Error(`Not allowed to open ${relativeToProcessCwd}`);
|
|
18
|
+
}
|
|
19
|
+
return fs_1.default.promises.readFile(p, 'utf-8');
|
|
20
|
+
};
|
|
21
|
+
exports.getFileSource = getFileSource;
|
|
22
|
+
//# sourceMappingURL=get-file-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file-source.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-file-source.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,4CAAoB;AAEpB,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAEhE,MAAM,aAAa,GAAG,CAAC,CAAS,EAAmB,EAAE;IAC3D,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE;QACtE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;KAC5C;IAED,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IAChD,MAAM,oBAAoB,GAAG,cAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;IACpE,IAAI,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QAC1C,MAAM,IAAI,KAAK,CAAC,uBAAuB,oBAAoB,EAAE,CAAC,CAAC;KAC/D;IAED,OAAO,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC,CAAC;AAZW,QAAA,aAAa,iBAYxB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
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 { ScriptLine } from './stack-frame';
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {number} line The line number to provide context around.
|
|
11
|
+
* @param {number} count The number of lines you'd like for context.
|
|
12
|
+
* @param {string[] | string} lines The source code.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getLinesAround(line: number, count: number, lines: string[] | string): ScriptLine[];
|
|
15
|
+
//# sourceMappingURL=get-lines-around.d.ts.map
|
|
@@ -0,0 +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,GAAG,MAAM,GACtB,UAAU,EAAE,CAed"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
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
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param {number} line The line number to provide context around.
|
|
17
|
+
* @param {number} count The number of lines you'd like for context.
|
|
18
|
+
* @param {string[] | string} lines The source code.
|
|
19
|
+
*/
|
|
20
|
+
function getLinesAround(line, count, lines) {
|
|
21
|
+
if (typeof lines === 'string') {
|
|
22
|
+
lines = lines.split('\n');
|
|
23
|
+
}
|
|
24
|
+
const result = [];
|
|
25
|
+
for (let index = Math.max(0, line - 1 - count); index <= Math.min(lines.length - 1, line - 1 + count); ++index) {
|
|
26
|
+
result.push(new stack_frame_1.ScriptLine(index + 1, lines[index], index === line - 1));
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
exports.getLinesAround = getLinesAround;
|
|
31
|
+
//# sourceMappingURL=get-lines-around.js.map
|
|
@@ -0,0 +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;;;AAEF;;;;;GAKG;AAEH,+CAAyC;AAEzC;;;;;GAKG;AACH,SAAgB,cAAc,CAC7B,IAAY,EACZ,KAAa,EACb,KAAwB;IAExB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9B,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KAC1B;IAED,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,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,IAAI,wBAAU,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;KACzE;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAnBD,wCAmBC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
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 { SourceMapConsumer } from 'source-map';
|
|
8
|
+
/**
|
|
9
|
+
* A wrapped instance of a <code>{@link https://github.com/mozilla/source-map SourceMapConsumer}</code>.
|
|
10
|
+
*
|
|
11
|
+
* This exposes methods which will be indifferent to changes made in <code>{@link https://github.com/mozilla/source-map source-map}</code>.
|
|
12
|
+
*/
|
|
13
|
+
declare class SourceMap {
|
|
14
|
+
__source_map: SourceMapConsumer;
|
|
15
|
+
constructor(sourceMap: SourceMapConsumer);
|
|
16
|
+
/**
|
|
17
|
+
* Returns the original code position for a generated code position.
|
|
18
|
+
* @param {number} line The line of the generated code position.
|
|
19
|
+
* @param {number} column The column of the generated code position.
|
|
20
|
+
*/
|
|
21
|
+
getOriginalPosition(line: number, column: number): {
|
|
22
|
+
source: string;
|
|
23
|
+
line: number;
|
|
24
|
+
column: number;
|
|
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
|
+
getSource(sourceName: string): string;
|
|
41
|
+
getSources(): string[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Returns an instance of <code>{@link SourceMap}</code> for a given fileUri and fileContents.
|
|
45
|
+
* @param {string} fileUri The URI of the source file.
|
|
46
|
+
* @param {string} fileContents The contents of the source file.
|
|
47
|
+
*/
|
|
48
|
+
declare function getSourceMap(fileUri: string, fileContents: string): Promise<SourceMap>;
|
|
49
|
+
export { getSourceMap };
|
|
50
|
+
//# sourceMappingURL=get-source-map.d.ts.map
|
|
@@ -0,0 +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,cAAM,SAAS;IACd,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;;;;;OAKG;IACH,oBAAoB,CACnB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACZ;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC;IAYjC;;;OAGG;IACH,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAIrC,UAAU,IAAI,MAAM,EAAE;CAItB;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"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
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
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getSourceMap = void 0;
|
|
7
|
+
/* eslint-disable no-eq-null */
|
|
8
|
+
/* eslint-disable eqeqeq */
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
const source_map_1 = require("source-map");
|
|
16
|
+
/**
|
|
17
|
+
* A wrapped instance of a <code>{@link https://github.com/mozilla/source-map SourceMapConsumer}</code>.
|
|
18
|
+
*
|
|
19
|
+
* This exposes methods which will be indifferent to changes made in <code>{@link https://github.com/mozilla/source-map source-map}</code>.
|
|
20
|
+
*/
|
|
21
|
+
class SourceMap {
|
|
22
|
+
constructor(sourceMap) {
|
|
23
|
+
this.__source_map = sourceMap;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the original code position for a generated code position.
|
|
27
|
+
* @param {number} line The line of the generated code position.
|
|
28
|
+
* @param {number} column The column of the generated code position.
|
|
29
|
+
*/
|
|
30
|
+
getOriginalPosition(line, column) {
|
|
31
|
+
const { line: l, column: c, source: s, } = this.__source_map.originalPositionFor({
|
|
32
|
+
line,
|
|
33
|
+
column,
|
|
34
|
+
});
|
|
35
|
+
return { line: l, column: c, source: s };
|
|
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
|
+
getSource(sourceName) {
|
|
59
|
+
return this.__source_map.sourceContentFor(sourceName);
|
|
60
|
+
}
|
|
61
|
+
getSources() {
|
|
62
|
+
// @ts-expect-error
|
|
63
|
+
return this.__source_map.sources;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function extractSourceMapUrl(fileUri, fileContents) {
|
|
67
|
+
const regex = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;
|
|
68
|
+
let match = null;
|
|
69
|
+
for (;;) {
|
|
70
|
+
const next = regex.exec(fileContents);
|
|
71
|
+
if (next == null) {
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
match = next;
|
|
75
|
+
}
|
|
76
|
+
if (!(match === null || match === void 0 ? void 0 : match[1])) {
|
|
77
|
+
return Promise.reject(new Error(`Cannot find a source map directive for ${fileUri}.`));
|
|
78
|
+
}
|
|
79
|
+
return Promise.resolve(match[1].toString());
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Returns an instance of <code>{@link SourceMap}</code> for a given fileUri and fileContents.
|
|
83
|
+
* @param {string} fileUri The URI of the source file.
|
|
84
|
+
* @param {string} fileContents The contents of the source file.
|
|
85
|
+
*/
|
|
86
|
+
async function getSourceMap(fileUri, fileContents) {
|
|
87
|
+
let sm = await extractSourceMapUrl(fileUri, fileContents);
|
|
88
|
+
if (sm.indexOf('data:') === 0) {
|
|
89
|
+
const base64 = /^data:application\/json;([\w=:"-]+;)*base64,/;
|
|
90
|
+
const match2 = sm.match(base64);
|
|
91
|
+
if (!match2) {
|
|
92
|
+
throw new Error('Sorry, non-base64 inline source-map encoding is not supported.');
|
|
93
|
+
}
|
|
94
|
+
sm = sm.substring(match2[0].length);
|
|
95
|
+
sm = window.atob(sm);
|
|
96
|
+
sm = JSON.parse(sm);
|
|
97
|
+
return new SourceMap(await new source_map_1.SourceMapConsumer(sm));
|
|
98
|
+
}
|
|
99
|
+
const index = fileUri.lastIndexOf('/');
|
|
100
|
+
const url = fileUri.substring(0, index + 1) + sm;
|
|
101
|
+
const obj = await fetch(url).then((res) => res.json());
|
|
102
|
+
return new SourceMap(await new source_map_1.SourceMapConsumer(obj));
|
|
103
|
+
}
|
|
104
|
+
exports.getSourceMap = getSourceMap;
|
|
105
|
+
//# sourceMappingURL=get-source-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-source-map.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/get-source-map.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
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 type { StackFrame } from './stack-frame';
|
|
8
|
+
declare type UnmappedError = Error & {
|
|
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 };
|
|
16
|
+
//# sourceMappingURL=get-stack-frames.d.ts.map
|
|
@@ -0,0 +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,UAAU,EAAC,MAAM,eAAe,CAAC;AAM9C,aAAK,aAAa,GAAG,KAAK,GAAG;IAC5B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC;AA2BF,iBAAe,cAAc,CAC5B,KAAK,EAAE,aAAa,EACpB,WAAW,SAAI,GACb,OAAO,CAAC;IAAC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,WAAW,GAAG,QAAQ,CAAA;CAAC,CAAC,CA6BtE;AAED,OAAO,EAAC,cAAc,EAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
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
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getStackFrames = void 0;
|
|
7
|
+
const parser_1 = require("./parser");
|
|
8
|
+
const unmapper_1 = require("./unmapper");
|
|
9
|
+
const map_error_to_react_stack_1 = require("../effects/map-error-to-react-stack");
|
|
10
|
+
const resolve_file_source_1 = require("../effects/resolve-file-source");
|
|
11
|
+
const getEnhancedFrames = async (error, parsedFrames, contextSize) => {
|
|
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);
|
|
28
|
+
if (enhancedFrames
|
|
29
|
+
.map((f) => f._originalFileName)
|
|
30
|
+
.filter((f_1) => f_1 !== null &&
|
|
31
|
+
f_1 !== undefined &&
|
|
32
|
+
f_1.indexOf('node_modules') === -1).length === 0) {
|
|
33
|
+
return { type, frames: null };
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
type,
|
|
37
|
+
frames: enhancedFrames.filter(({ functionName }) => functionName === null ||
|
|
38
|
+
functionName === undefined ||
|
|
39
|
+
functionName.indexOf('__stack_frame_overlay_proxy_console__') === -1),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.getStackFrames = getStackFrames;
|
|
43
|
+
//# sourceMappingURL=get-stack-frames.js.map
|
|
@@ -0,0 +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;AACjC,kFAA8E;AAC9E,wEAAiE;AAMjE,MAAM,iBAAiB,GAAG,KAAK,EAC9B,KAAoB,EACpB,YAA0B,EAC1B,WAAmB,EAIjB,EAAE;IACJ,IAAI,KAAK,CAAC,cAAc,EAAE;QACzB,OAAO;YACN,MAAM,EAAE,MAAM,IAAA,gBAAK,EAAC,KAAK,CAAC,cAAc,EAAE,YAAY,EAAE,WAAW,CAAC;YACpE,IAAI,EAAE,WAAW;SACjB,CAAC;KACF;IAED,MAAM,QAAQ,GAAG,IAAA,oDAAyB,EAAC,KAAK,CAAC,CAAC;IAClD,IAAI,QAAQ,KAAK,IAAI,EAAE;QACtB,OAAO,EAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAC,CAAC;KACvC;IAED,MAAM,MAAM,GAAG,MAAM,IAAA,uCAAiB,EAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAE9D,OAAO,EAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,KAAK,UAAU,cAAc,CAC5B,KAAoB,EACpB,WAAW,GAAG,CAAC;IAEf,MAAM,YAAY,GAAG,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC;IACvC,MAAM,EAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAC,GAAG,MAAM,iBAAiB,CAC7D,KAAK,EACL,YAAY,EACZ,WAAW,CACX,CAAC;IACF,IACC,cAAc;SACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;SAC/B,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,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC;KAC5B;IAED,OAAO;QACN,IAAI;QACJ,MAAM,EAAE,cAAc,CAAC,MAAM,CAC5B,CAAC,EAAC,YAAY,EAAC,EAAE,EAAE,CAClB,YAAY,KAAK,IAAI;YACrB,YAAY,KAAK,SAAS;YAC1B,YAAY,CAAC,OAAO,CAAC,uCAAuC,CAAC,KAAK,CAAC,CAAC,CACrE;KACD,CAAC;AACH,CAAC;AAEO,wCAAc"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
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
|
+
* Enhances a set of <code>StackFrame</code>s with their original positions and code (when available).
|
|
10
|
+
* @param {StackFrame[]} frames A set of <code>StackFrame</code>s which contain (generated) code positions.
|
|
11
|
+
* @param {number} [contextLines=3] The number of lines to provide before and after the line specified in the <code>StackFrame</code>.
|
|
12
|
+
*/
|
|
13
|
+
declare function map(frames: StackFrame[], contextLines?: number): Promise<StackFrame[]>;
|
|
14
|
+
export { map };
|
|
15
|
+
export default map;
|
|
16
|
+
//# sourceMappingURL=mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/mapper.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAKzC;;;;GAIG;AACH,iBAAe,GAAG,CACjB,MAAM,EAAE,UAAU,EAAE,EACpB,YAAY,SAAI,GACd,OAAO,CAAC,UAAU,EAAE,CAAC,CA4DvB;AAED,OAAO,EAAC,GAAG,EAAC,CAAC;AACb,eAAe,GAAG,CAAC"}
|