@expo/metro-runtime 2.0.6 → 2.1.0
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/build/error-overlay/Data/LogBoxData.d.ts.map +1 -1
- package/build/error-overlay/Data/LogBoxData.js +7 -1
- package/build/error-overlay/Data/LogBoxData.js.map +1 -1
- package/build/error-overlay/Data/LogBoxLog.d.ts +26 -19
- package/build/error-overlay/Data/LogBoxLog.d.ts.map +1 -1
- package/build/error-overlay/Data/LogBoxLog.js +50 -14
- package/build/error-overlay/Data/LogBoxLog.js.map +1 -1
- package/build/error-overlay/Data/LogContext.d.ts +1 -1
- package/build/error-overlay/Data/LogContext.d.ts.map +1 -1
- package/build/error-overlay/Data/LogContext.js +14 -5
- package/build/error-overlay/Data/LogContext.js.map +1 -1
- package/build/error-overlay/ErrorOverlay.d.ts +8 -1
- package/build/error-overlay/ErrorOverlay.d.ts.map +1 -1
- package/build/error-overlay/ErrorOverlay.js +20 -19
- package/build/error-overlay/ErrorOverlay.js.map +1 -1
- package/build/error-overlay/formatProjectFilePath.d.ts +6 -1
- package/build/error-overlay/formatProjectFilePath.d.ts.map +1 -1
- package/build/error-overlay/formatProjectFilePath.js +14 -7
- package/build/error-overlay/formatProjectFilePath.js.map +1 -1
- package/build/error-overlay/modules/symbolicateStackTrace/index.d.ts.map +1 -1
- package/build/error-overlay/modules/symbolicateStackTrace/index.js +3 -1
- package/build/error-overlay/modules/symbolicateStackTrace/index.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js +2 -3
- package/build/error-overlay/overlay/LogBoxInspectorCodeFrame.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorFooter.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js +7 -0
- package/build/error-overlay/overlay/LogBoxInspectorHeader.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js +3 -0
- package/build/error-overlay/overlay/LogBoxInspectorMessageHeader.js.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.d.ts.map +1 -1
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js +1 -7
- package/build/error-overlay/overlay/LogBoxInspectorStackFrame.js.map +1 -1
- package/build/symbolicate.d.ts +5 -0
- package/build/symbolicate.d.ts.map +1 -0
- package/build/symbolicate.js +26 -0
- package/build/symbolicate.js.map +1 -0
- package/package.json +4 -2
- package/symbolicate/index.d.ts +1 -0
- package/symbolicate/index.js +1 -0
- package/build/async-require/__tests__/buildAsyncRequire.test.d.ts +0 -3
- package/build/async-require/__tests__/buildAsyncRequire.test.d.ts.map +0 -1
- package/build/async-require/__tests__/buildAsyncRequire.test.js +0 -71
- package/build/async-require/__tests__/buildAsyncRequire.test.js.map +0 -1
- package/build/async-require/__tests__/buildUrlForBundle.test.native.d.ts +0 -3
- package/build/async-require/__tests__/buildUrlForBundle.test.native.d.ts.map +0 -1
- package/build/async-require/__tests__/buildUrlForBundle.test.native.js +0 -38
- package/build/async-require/__tests__/buildUrlForBundle.test.native.js.map +0 -1
- package/build/async-require/__tests__/buildUrlForBundle.test.web.d.ts +0 -2
- package/build/async-require/__tests__/buildUrlForBundle.test.web.d.ts.map +0 -1
- package/build/async-require/__tests__/buildUrlForBundle.test.web.js +0 -13
- package/build/async-require/__tests__/buildUrlForBundle.test.web.js.map +0 -1
- package/build/async-require/__tests__/fetchAsync.test.web.d.ts +0 -2
- package/build/async-require/__tests__/fetchAsync.test.web.d.ts.map +0 -1
- package/build/async-require/__tests__/fetchAsync.test.web.js +0 -22
- package/build/async-require/__tests__/fetchAsync.test.web.js.map +0 -1
- package/build/async-require/__tests__/loadBundlePolyfill.test.ios.d.ts +0 -2
- package/build/async-require/__tests__/loadBundlePolyfill.test.ios.d.ts.map +0 -1
- package/build/async-require/__tests__/loadBundlePolyfill.test.ios.js +0 -32
- package/build/async-require/__tests__/loadBundlePolyfill.test.ios.js.map +0 -1
- package/build/async-require/__tests__/loadBundlePolyfill.test.web.d.ts +0 -2
- package/build/async-require/__tests__/loadBundlePolyfill.test.web.d.ts.map +0 -1
- package/build/async-require/__tests__/loadBundlePolyfill.test.web.js +0 -31
- package/build/async-require/__tests__/loadBundlePolyfill.test.web.js.map +0 -1
- package/build/transformer/css/__tests__/css-transformer.test.web.d.ts +0 -2
- package/build/transformer/css/__tests__/css-transformer.test.web.d.ts.map +0 -1
- package/build/transformer/css/__tests__/css-transformer.test.web.js +0 -111
- package/build/transformer/css/__tests__/css-transformer.test.web.js.map +0 -1
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
3
|
+
exports.getStackFormattedLocation = exports.formatProjectFilePath = void 0;
|
|
4
|
+
function formatProjectFilePath(projectRoot, file) {
|
|
5
5
|
if (file == null) {
|
|
6
6
|
return "<unknown>";
|
|
7
7
|
}
|
|
8
|
-
const projectRoot = process.env.EXPO_PROJECT_ROOT;
|
|
9
|
-
if (!projectRoot) {
|
|
10
|
-
return file;
|
|
11
|
-
}
|
|
12
8
|
return pathRelativeToPath(file.replace(/\\/g, "/"), projectRoot.replace(/\\/g, "/")).replace(/\?.*$/, "");
|
|
13
9
|
}
|
|
14
|
-
exports.
|
|
10
|
+
exports.formatProjectFilePath = formatProjectFilePath;
|
|
15
11
|
function pathRelativeToPath(path, relativeTo, sep = "/") {
|
|
16
12
|
const relativeToParts = relativeTo.split(sep);
|
|
17
13
|
const pathParts = path.split(sep);
|
|
@@ -24,4 +20,15 @@ function pathRelativeToPath(path, relativeTo, sep = "/") {
|
|
|
24
20
|
}
|
|
25
21
|
return pathParts.slice(i).join(sep);
|
|
26
22
|
}
|
|
23
|
+
function getStackFormattedLocation(projectRoot, frame) {
|
|
24
|
+
const column = frame.column != null && parseInt(String(frame.column), 10);
|
|
25
|
+
const location = formatProjectFilePath(projectRoot, frame.file) +
|
|
26
|
+
(frame.lineNumber != null
|
|
27
|
+
? ":" +
|
|
28
|
+
frame.lineNumber +
|
|
29
|
+
(column && !isNaN(column) ? ":" + (column + 1) : "")
|
|
30
|
+
: "");
|
|
31
|
+
return location;
|
|
32
|
+
}
|
|
33
|
+
exports.getStackFormattedLocation = getStackFormattedLocation;
|
|
27
34
|
//# sourceMappingURL=formatProjectFilePath.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatProjectFilePath.js","sourceRoot":"","sources":["../../src/error-overlay/formatProjectFilePath.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"formatProjectFilePath.js","sourceRoot":"","sources":["../../src/error-overlay/formatProjectFilePath.ts"],"names":[],"mappings":";;;AAIA,SAAgB,qBAAqB,CACnC,WAAmB,EACnB,IAAoB;IAEpB,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO,WAAW,CAAC;KACpB;IAED,OAAO,kBAAkB,CACvB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EACxB,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAChC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACzB,CAAC;AAZD,sDAYC;AAED,SAAS,kBAAkB,CAAC,IAAY,EAAE,UAAkB,EAAE,GAAG,GAAG,GAAG;IACrE,MAAM,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,eAAe,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE;QACzD,IAAI,eAAe,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;YACvC,MAAM;SACP;QACD,CAAC,EAAE,CAAC;KACL;IACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,SAAgB,yBAAyB,CACvC,WAAmB,EACnB,KAAsB;IAEtB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1E,MAAM,QAAQ,GACZ,qBAAqB,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC;QAC9C,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI;YACvB,CAAC,CAAC,GAAG;gBACH,KAAK,CAAC,UAAU;gBAChB,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACtD,CAAC,CAAC,EAAE,CAAC,CAAC;IAEV,OAAO,QAAQ,CAAC;AAClB,CAAC;AAdD,8DAcC","sourcesContent":["import type { StackFrame } from \"stacktrace-parser\";\n\nexport type MetroStackFrame = StackFrame & { collapse?: boolean };\n\nexport function formatProjectFilePath(\n projectRoot: string,\n file?: string | null\n): string {\n if (file == null) {\n return \"<unknown>\";\n }\n\n return pathRelativeToPath(\n file.replace(/\\\\/g, \"/\"),\n projectRoot.replace(/\\\\/g, \"/\")\n ).replace(/\\?.*$/, \"\");\n}\n\nfunction pathRelativeToPath(path: string, relativeTo: string, sep = \"/\") {\n const relativeToParts = relativeTo.split(sep);\n const pathParts = path.split(sep);\n let i = 0;\n while (i < relativeToParts.length && i < pathParts.length) {\n if (relativeToParts[i] !== pathParts[i]) {\n break;\n }\n i++;\n }\n return pathParts.slice(i).join(sep);\n}\n\nexport function getStackFormattedLocation(\n projectRoot: string,\n frame: MetroStackFrame\n) {\n const column = frame.column != null && parseInt(String(frame.column), 10);\n const location =\n formatProjectFilePath(projectRoot, frame.file) +\n (frame.lineNumber != null\n ? \":\" +\n frame.lineNumber +\n (column && !isNaN(column) ? \":\" + (column + 1) : \"\")\n : \"\");\n\n return location;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,iBAAe,qBAAqB,CAClC,KAAK,EAAE,UAAU,EAAE,GAClB,OAAO,CAAC,sBAAsB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,iBAAe,qBAAqB,CAClC,KAAK,EAAE,UAAU,EAAE,GAClB,OAAO,CAAC,sBAAsB,CAAC,CAWjC;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
async function symbolicateStackTrace(stack) {
|
|
11
|
-
const baseUrl = window
|
|
11
|
+
const baseUrl = typeof window === "undefined"
|
|
12
|
+
? process.env.EXPO_DEV_SERVER_ORIGIN
|
|
13
|
+
: window.location.protocol + "//" + window.location.host;
|
|
12
14
|
const response = await fetch(baseUrl + "/symbolicate", {
|
|
13
15
|
method: "POST",
|
|
14
16
|
body: JSON.stringify({ stack }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAmBH,KAAK,UAAU,qBAAqB,CAClC,KAAmB;IAEnB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/error-overlay/modules/symbolicateStackTrace/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAmBH,KAAK,UAAU,qBAAqB,CAClC,KAAmB;IAEnB,MAAM,OAAO,GACX,OAAO,MAAM,KAAK,WAAW;QAC3B,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB;QACpC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAE7D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,GAAG,cAAc,EAAE;QACrD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC;KAChC,CAAC,CAAC;IACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC;AAED,kBAAe,qBAAqB,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { StackFrame } from \"stacktrace-parser\";\n\nexport type CodeFrame = {\n content: string;\n location?: {\n row: number;\n column: number;\n [key: string]: any;\n };\n fileName: string;\n};\n\nexport type SymbolicatedStackTrace = {\n stack: StackFrame[];\n codeFrame?: CodeFrame;\n};\n\nasync function symbolicateStackTrace(\n stack: StackFrame[]\n): Promise<SymbolicatedStackTrace> {\n const baseUrl =\n typeof window === \"undefined\"\n ? process.env.EXPO_DEV_SERVER_ORIGIN\n : window.location.protocol + \"//\" + window.location.host;\n\n const response = await fetch(baseUrl + \"/symbolicate\", {\n method: \"POST\",\n body: JSON.stringify({ stack }),\n });\n return await response.json();\n}\n\nexport default symbolicateStackTrace;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeFrame } from "../Data/parseLogBoxLog";
|
|
2
|
-
export declare function LogBoxInspectorCodeFrame(
|
|
2
|
+
export declare function LogBoxInspectorCodeFrame({ codeFrame, }: {
|
|
3
3
|
codeFrame?: CodeFrame;
|
|
4
4
|
}): JSX.Element | null;
|
|
5
5
|
//# sourceMappingURL=LogBoxInspectorCodeFrame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorCodeFrame.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorCodeFrame.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAUxD,wBAAgB,wBAAwB,CAAC,EACvC,SAAS,GACV,EAAE;IACD,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,sBAiDA"}
|
|
@@ -43,13 +43,12 @@ const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
|
|
|
43
43
|
const constants_1 = require("../UI/constants");
|
|
44
44
|
const formatProjectFilePath_1 = require("../formatProjectFilePath");
|
|
45
45
|
const openFileInEditor_1 = __importDefault(require("../modules/openFileInEditor"));
|
|
46
|
-
function LogBoxInspectorCodeFrame(
|
|
47
|
-
const codeFrame = props.codeFrame;
|
|
46
|
+
function LogBoxInspectorCodeFrame({ codeFrame, }) {
|
|
48
47
|
if (codeFrame == null) {
|
|
49
48
|
return null;
|
|
50
49
|
}
|
|
51
50
|
function getFileName() {
|
|
52
|
-
return (0, formatProjectFilePath_1.
|
|
51
|
+
return (0, formatProjectFilePath_1.formatProjectFilePath)(process.env.EXPO_PROJECT_ROOT, codeFrame === null || codeFrame === void 0 ? void 0 : codeFrame.fileName);
|
|
53
52
|
}
|
|
54
53
|
function getLocation() {
|
|
55
54
|
const location = codeFrame === null || codeFrame === void 0 ? void 0 : codeFrame.location;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorCodeFrame.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAkE;AAElE,qEAAkE;AAElE,uDAA2C;AAC3C,qDAAkD;AAClD,+DAAiD;AACjD,+CAA4C;AAC5C,oEAAiE;AACjE,mFAA2D;
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorCodeFrame.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorCodeFrame.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAkE;AAElE,qEAAkE;AAElE,uDAA2C;AAC3C,qDAAkD;AAClD,+DAAiD;AACjD,+CAA4C;AAC5C,oEAAiE;AACjE,mFAA2D;AAI3D,SAAgB,wBAAwB,CAAC,EACvC,SAAS,GAGV;IACC,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,OAAO,IAAI,CAAC;KACb;IAED,SAAS,WAAW;QAClB,OAAO,IAAA,6CAAqB,EAC1B,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAC7B,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,CACpB,CAAC;IACJ,CAAC;IAED,SAAS,WAAW;QAClB,MAAM,QAAQ,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,CAAC;QACrC,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,OAAO,KAAK,QAAQ,CAAC,GAAG,IACtB,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,yCACtB,GAAG,CAAC;SACL;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,8BAAC,+CAAsB,IAAC,OAAO,EAAC,QAAQ;QACtC,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,GAAG;YACrB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK;gBACvB,8BAAC,yBAAU,IAAC,UAAU;oBACpB,8BAAC,oBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,E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CAAC,GAAG,CAAC;QACpC,SAAS,EAAE,QAAQ;QACnB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,qBAAS;KACtB;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from \"react\";\nimport { ScrollView, StyleSheet, Text, View } from \"react-native\";\n\nimport { LogBoxInspectorSection } from \"./LogBoxInspectorSection\";\nimport type { CodeFrame } from \"../Data/parseLogBoxLog\";\nimport { Ansi } from \"../UI/AnsiHighlight\";\nimport { LogBoxButton } from \"../UI/LogBoxButton\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\nimport { CODE_FONT } from \"../UI/constants\";\nimport { formatProjectFilePath } from \"../formatProjectFilePath\";\nimport openFileInEditor from \"../modules/openFileInEditor\";\n\ndeclare const process: any;\n\nexport function LogBoxInspectorCodeFrame({\n codeFrame,\n}: {\n codeFrame?: CodeFrame;\n}) {\n if (codeFrame == null) {\n return null;\n }\n\n function getFileName() {\n return formatProjectFilePath(\n process.env.EXPO_PROJECT_ROOT,\n codeFrame?.fileName\n );\n }\n\n function getLocation() {\n const location = codeFrame?.location;\n if (location != null) {\n return ` (${location.row}:${\n location.column + 1 /* Code frame columns are zero indexed */\n })`;\n }\n\n return null;\n }\n\n return (\n <LogBoxInspectorSection heading=\"Source\">\n <View style={styles.box}>\n <View style={styles.frame}>\n <ScrollView horizontal>\n <Ansi style={styles.content} text={codeFrame.content} />\n </ScrollView>\n </View>\n <LogBoxButton\n backgroundColor={{\n default: \"transparent\",\n pressed: LogBoxStyle.getBackgroundDarkColor(1),\n }}\n style={styles.button}\n onPress={() => {\n openFileInEditor(codeFrame.fileName, codeFrame.location?.row ?? 0);\n }}\n >\n <Text selectable={false} style={styles.fileText}>\n {getFileName()}\n {getLocation()}\n </Text>\n </LogBoxButton>\n </View>\n </LogBoxInspectorSection>\n );\n}\n\nconst styles = StyleSheet.create({\n box: {\n backgroundColor: LogBoxStyle.getBackgroundColor(),\n borderWidth: 1,\n borderColor: \"#323232\",\n marginLeft: 10,\n marginRight: 10,\n marginTop: 5,\n borderRadius: 3,\n },\n frame: {\n padding: 10,\n borderBottomColor: LogBoxStyle.getTextColor(0.1),\n borderBottomWidth: 1,\n },\n button: {\n paddingTop: 10,\n paddingBottom: 10,\n },\n content: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 12,\n includeFontPadding: false,\n lineHeight: 20,\n fontFamily: CODE_FONT,\n },\n fileText: {\n color: LogBoxStyle.getTextColor(0.5),\n textAlign: \"center\",\n flex: 1,\n fontSize: 16,\n includeFontPadding: false,\n fontFamily: CODE_FONT,\n },\n});\n"]}
|
|
@@ -40,7 +40,7 @@ const LogContext_1 = require("../Data/LogContext");
|
|
|
40
40
|
const LogBoxStyle = __importStar(require("../UI/LogBoxStyle"));
|
|
41
41
|
function LogBoxInspectorFooter(props) {
|
|
42
42
|
const log = (0, LogContext_1.useSelectedLog)();
|
|
43
|
-
if (
|
|
43
|
+
if (["static", "syntax"].includes(log.level)) {
|
|
44
44
|
return (react_1.default.createElement(react_views_1.View, { style: styles.root },
|
|
45
45
|
react_1.default.createElement(react_views_1.View, { style: styles.button },
|
|
46
46
|
react_1.default.createElement(react_views_1.Text, { style: styles.syntaxErrorText }, "This error cannot be dismissed."))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorFooter.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,qDAAwE;AACxE,kDAA0B;AAE1B,mDAAoD;AACpD,+DAAiD;AAOjD,SAAgB,qBAAqB,CAAC,KAAY;IAChD,MAAM,GAAG,GAAG,IAAA,2BAAc,GAAE,CAAC;IAE7B,IAAI,GAAG,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorFooter.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,qDAAwE;AACxE,kDAA0B;AAE1B,mDAAoD;AACpD,+DAAiD;AAOjD,SAAgB,qBAAqB,CAAC,KAAY;IAChD,MAAM,GAAG,GAAG,IAAA,2BAAc,GAAE,CAAC;IAE7B,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC5C,OAAO,CACL,8BAAC,kBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;YACtB,8BAAC,kBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM;gBACxB,8BAAC,kBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,eAAe,sCAE5B,CACF,CACF,CACR,CAAC;KACH;IAED,OAAO,CACL,8BAAC,kBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;QACtB,8BAAC,YAAY,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,KAAK,CAAC,SAAS,GAAI;QACzD,8BAAC,YAAY,IAAC,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,KAAK,CAAC,UAAU,GAAI,CACtD,CACR,CAAC;AACJ,CAAC;AArBD,sDAqBC;AAED,SAAS,YAAY,CAAC,EACpB,IAAI,EACJ,OAAO,GAIR;IACC,OAAO,CACL,8BAAC,uBAAS,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAC5C,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACzB,8BAAC,kBAAI,IACH,KAAK,EAAE;YACL,YAAY,CAAC,QAAQ;YACrB;gBACE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QACV,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,EAAE;QACjB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;KACrC;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Pressable, StyleSheet, Text, View } from \"@bacons/react-views\";\nimport React from \"react\";\n\nimport { useSelectedLog } from \"../Data/LogContext\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\n\ntype Props = {\n onDismiss: () => void;\n onMinimize: () => void;\n};\n\nexport function LogBoxInspectorFooter(props: Props) {\n const log = useSelectedLog();\n\n if ([\"static\", \"syntax\"].includes(log.level)) {\n return (\n <View style={styles.root}>\n <View style={styles.button}>\n <Text style={styles.syntaxErrorText}>\n This error cannot be dismissed.\n </Text>\n </View>\n </View>\n );\n }\n\n return (\n <View style={styles.root}>\n <FooterButton text=\"Dismiss\" onPress={props.onDismiss} />\n <FooterButton text=\"Minimize\" onPress={props.onMinimize} />\n </View>\n );\n}\n\nfunction FooterButton({\n text,\n onPress,\n}: {\n onPress: () => void;\n text: string;\n}) {\n return (\n <Pressable onPress={onPress} style={{ flex: 1 }}>\n {({ hovered, pressed }) => (\n <View\n style={[\n buttonStyles.safeArea,\n {\n transitionDuration: \"150ms\",\n backgroundColor: pressed\n ? \"#323232\"\n : hovered\n ? \"#111111\"\n : LogBoxStyle.getBackgroundColor(),\n },\n ]}\n >\n <View style={buttonStyles.content}>\n <Text selectable={false} style={buttonStyles.label}>\n {text}\n </Text>\n </View>\n </View>\n )}\n </Pressable>\n );\n}\n\nconst buttonStyles = StyleSheet.create({\n safeArea: {\n flex: 1,\n borderTopWidth: 1,\n borderColor: \"#323232\",\n // paddingBottom: DeviceInfo.getConstants().isIPhoneX_deprecated ? 30 : 0,\n },\n content: {\n alignItems: \"center\",\n height: 48,\n justifyContent: \"center\",\n },\n label: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 20,\n },\n});\n\nconst styles = StyleSheet.create({\n root: {\n backgroundColor: LogBoxStyle.getBackgroundColor(1),\n shadowColor: \"#000\",\n shadowOffset: { width: 0, height: -2 },\n shadowRadius: 2,\n shadowOpacity: 0.5,\n flexDirection: \"row\",\n },\n button: {\n flex: 1,\n },\n syntaxErrorText: {\n textAlign: \"center\",\n width: \"100%\",\n height: 48,\n fontSize: 14,\n lineHeight: 20,\n paddingTop: 20,\n paddingBottom: 50,\n fontStyle: \"italic\",\n color: LogBoxStyle.getTextColor(0.6),\n },\n});\n"]}
|
|
@@ -76,6 +76,10 @@ const backgroundForLevel = (level) => ({
|
|
|
76
76
|
default: "transparent",
|
|
77
77
|
pressed: LogBoxStyle.getFatalDarkColor(),
|
|
78
78
|
},
|
|
79
|
+
static: {
|
|
80
|
+
default: "transparent",
|
|
81
|
+
pressed: LogBoxStyle.getFatalDarkColor(),
|
|
82
|
+
},
|
|
79
83
|
}[level]);
|
|
80
84
|
function LogBoxInspectorHeaderButton(props) {
|
|
81
85
|
return (react_1.default.createElement(LogBoxButton_1.LogBoxButton, { backgroundColor: backgroundForLevel(props.level), onPress: props.disabled ? undefined : props.onPress, style: headerStyles.button }, props.disabled ? null : (react_1.default.createElement(react_native_1.Image, { source: props.image, style: headerStyles.buttonImage }))));
|
|
@@ -104,6 +108,9 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
104
108
|
syntax: {
|
|
105
109
|
backgroundColor: LogBoxStyle.getFatalColor(),
|
|
106
110
|
},
|
|
111
|
+
static: {
|
|
112
|
+
backgroundColor: LogBoxStyle.getFatalColor(),
|
|
113
|
+
},
|
|
107
114
|
fatal: {
|
|
108
115
|
backgroundColor: LogBoxStyle.getFatalColor(),
|
|
109
116
|
},
|
|
@@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;QACpB,MAAM,EAAE,uBAAQ,CAAC,MAAM,CAAC;YACtB,OAAO,EAAE,EAAE;YACX,GAAG,EAAE,EAAE;SACR,CAAC;KACH;IACD,KAAK,EAAE;QACL,UAAU,EAAE,QAAQ;QACpB,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;KACzB;IACD,SAAS,EAAE;QACT,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE;QACjC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;IACD,QAAQ,EAAE;QACR,UAAU,EAAE,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,wBAAS,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE;KACjE;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from \"react\";\nimport {\n Image,\n Platform,\n StatusBar,\n StyleSheet,\n Text,\n View,\n} from \"react-native\";\n\nimport type { LogLevel } from \"../Data/LogBoxLog\";\nimport { useLogs } from \"../Data/LogContext\";\nimport { LogBoxButton } from \"../UI/LogBoxButton\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\n\ntype Props = {\n onSelectIndex: (selectedIndex: number) => void;\n level: LogLevel;\n};\n\nexport function LogBoxInspectorHeader(props: Props) {\n const { selectedLogIndex: selectedIndex, logs } = useLogs();\n const total = logs.length;\n\n if (props.level === \"syntax\") {\n return (\n <View style={[styles.safeArea, styles[props.level]]}>\n <View style={styles.header}>\n <View style={styles.title}>\n <Text style={styles.titleText}>Failed to compile</Text>\n </View>\n </View>\n </View>\n );\n }\n\n const prevIndex = selectedIndex - 1 < 0 ? total - 1 : selectedIndex - 1;\n const nextIndex = selectedIndex + 1 > total - 1 ? 0 : selectedIndex + 1;\n\n const titleText = `Log ${selectedIndex + 1} of ${total}`;\n\n return (\n <View style={[styles.safeArea, styles[props.level]]}>\n <View style={styles.header}>\n <LogBoxInspectorHeaderButton\n disabled={total <= 1}\n level={props.level}\n image={require(\"@expo/metro-runtime/assets/chevron-left.png\")}\n onPress={() => props.onSelectIndex(prevIndex)}\n />\n <View style={styles.title}>\n <Text style={styles.titleText}>{titleText}</Text>\n </View>\n <LogBoxInspectorHeaderButton\n disabled={total <= 1}\n level={props.level}\n image={require(\"@expo/metro-runtime/assets/chevron-right.png\")}\n onPress={() => props.onSelectIndex(nextIndex)}\n />\n </View>\n </View>\n );\n}\n\nconst backgroundForLevel = (level: LogLevel) =>\n ({\n warn: {\n default: \"transparent\",\n pressed: LogBoxStyle.getWarningDarkColor(),\n },\n error: {\n default: \"transparent\",\n pressed: LogBoxStyle.getErrorDarkColor(),\n },\n fatal: {\n default: \"transparent\",\n pressed: LogBoxStyle.getFatalDarkColor(),\n },\n syntax: {\n default: \"transparent\",\n pressed: LogBoxStyle.getFatalDarkColor(),\n },\n }[level]);\n\nfunction LogBoxInspectorHeaderButton(props: {\n disabled: boolean;\n image: number;\n level: LogLevel;\n onPress?: () => void;\n}) {\n return (\n <LogBoxButton\n backgroundColor={backgroundForLevel(props.level)}\n onPress={props.disabled ? undefined : props.onPress}\n style={headerStyles.button}\n >\n {props.disabled ? null : (\n <Image source={props.image} style={headerStyles.buttonImage} />\n )}\n </LogBoxButton>\n );\n}\n\nconst headerStyles = StyleSheet.create({\n button: {\n alignItems: \"center\",\n aspectRatio: 1,\n justifyContent: \"center\",\n marginTop: 5,\n marginRight: 6,\n marginLeft: 6,\n marginBottom: Platform.select({\n web: 0,\n default: -8,\n }),\n borderRadius: 3,\n },\n buttonImage: {\n height: 14,\n width: 8,\n tintColor: LogBoxStyle.getTextColor(),\n },\n});\n\nconst styles = StyleSheet.create({\n syntax: {\n backgroundColor: LogBoxStyle.getFatalColor(),\n },\n fatal: {\n backgroundColor: LogBoxStyle.getFatalColor(),\n },\n warn: {\n backgroundColor: LogBoxStyle.getWarningColor(),\n },\n error: {\n backgroundColor: LogBoxStyle.getErrorColor(),\n },\n header: {\n flexDirection: \"row\",\n height: Platform.select({\n default: 48,\n ios: 44,\n }),\n },\n title: {\n alignItems: \"center\",\n flex: 1,\n justifyContent: \"center\",\n },\n titleText: {\n color: LogBoxStyle.getTextColor(),\n fontSize: 16,\n fontWeight: \"600\",\n includeFontPadding: false,\n lineHeight: 20,\n },\n safeArea: {\n paddingTop: Platform.OS !== \"ios\" ? StatusBar.currentHeight : 40,\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorHeader.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAOsB;AAGtB,mDAA6C;AAC7C,qDAAkD;AAClD,+DAAiD;AAOjD,SAAgB,qBAAqB,CAAC,KAAY;IAChD,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,IAAA,oBAAO,GAAE,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;IAE1B,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;QAC5B,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACjD,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM;gBACxB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK;oBACvB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,SAAS,wBAA0B,CAClD,CACF,CACF,CACR,CAAC;KACH;IAED,MAAM,SAAS,GAAG,aAAa,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAA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;QACV,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,WAAW,CAAC,YAAY,EAAE;KACtC;CACF,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,eAAe,EAAE,WAAW,CAAC,aAAa,EAAE;KAC7C;IACD,MAAM,EAAE;QACN,eAAe,EAAE,WAAW,CAAC,aAAa,EAAE;KAC7C;IACD,KAAK,EAAE;QACL,eAAe,EAAE,WAAW,CAAC,aAAa,EAAE;KAC7C;IACD,IAAI,EAAE;QACJ,eAAe,EAAE,WAAW,CAAC,eAAe,EAAE;KAC/C;IACD,KAAK,EAAE;QACL,eAAe,EAAE,WAAW,CAAC,aAAa,EAAE;KAC7C;IACD,MAAM,EAAE;QACN,aAAa,EAAE,KAAK;QACpB,MAAM,EAAE,uBAAQ,CAAC,MAAM,CAAC;YACtB,OAAO,EAAE,EAAE;YACX,GAAG,EAAE,EAAE;SACR,CAAC;KACH;IACD,KAAK,EAAE;QACL,UAAU,EAAE,QAAQ;QACpB,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;KACzB;IACD,SAAS,EAAE;QACT,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE;QACjC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;IACD,QAAQ,EAAE;QACR,UAAU,EAAE,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,wBAAS,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE;KACjE;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from \"react\";\nimport {\n Image,\n Platform,\n StatusBar,\n StyleSheet,\n Text,\n View,\n} from \"react-native\";\n\nimport type { LogLevel } from \"../Data/LogBoxLog\";\nimport { useLogs } from \"../Data/LogContext\";\nimport { LogBoxButton } from \"../UI/LogBoxButton\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\n\ntype Props = {\n onSelectIndex: (selectedIndex: number) => void;\n level: LogLevel;\n};\n\nexport function LogBoxInspectorHeader(props: Props) {\n const { selectedLogIndex: selectedIndex, logs } = useLogs();\n const total = logs.length;\n\n if (props.level === \"syntax\") {\n return (\n <View style={[styles.safeArea, styles[props.level]]}>\n <View style={styles.header}>\n <View style={styles.title}>\n <Text style={styles.titleText}>Failed to compile</Text>\n </View>\n </View>\n </View>\n );\n }\n\n const prevIndex = selectedIndex - 1 < 0 ? total - 1 : selectedIndex - 1;\n const nextIndex = selectedIndex + 1 > total - 1 ? 0 : selectedIndex + 1;\n\n const titleText = `Log ${selectedIndex + 1} of ${total}`;\n\n return (\n <View style={[styles.safeArea, styles[props.level]]}>\n <View style={styles.header}>\n <LogBoxInspectorHeaderButton\n disabled={total <= 1}\n level={props.level}\n image={require(\"@expo/metro-runtime/assets/chevron-left.png\")}\n onPress={() => props.onSelectIndex(prevIndex)}\n />\n <View style={styles.title}>\n <Text style={styles.titleText}>{titleText}</Text>\n </View>\n <LogBoxInspectorHeaderButton\n disabled={total <= 1}\n level={props.level}\n image={require(\"@expo/metro-runtime/assets/chevron-right.png\")}\n onPress={() => props.onSelectIndex(nextIndex)}\n />\n </View>\n </View>\n );\n}\n\nconst backgroundForLevel = (level: LogLevel) =>\n ({\n warn: {\n default: \"transparent\",\n pressed: LogBoxStyle.getWarningDarkColor(),\n },\n error: {\n default: \"transparent\",\n pressed: LogBoxStyle.getErrorDarkColor(),\n },\n fatal: {\n default: \"transparent\",\n pressed: LogBoxStyle.getFatalDarkColor(),\n },\n syntax: {\n default: \"transparent\",\n pressed: LogBoxStyle.getFatalDarkColor(),\n },\n static: {\n default: \"transparent\",\n pressed: LogBoxStyle.getFatalDarkColor(),\n },\n }[level]);\n\nfunction LogBoxInspectorHeaderButton(props: {\n disabled: boolean;\n image: number;\n level: LogLevel;\n onPress?: () => void;\n}) {\n return (\n <LogBoxButton\n backgroundColor={backgroundForLevel(props.level)}\n onPress={props.disabled ? undefined : props.onPress}\n style={headerStyles.button}\n >\n {props.disabled ? null : (\n <Image source={props.image} style={headerStyles.buttonImage} />\n )}\n </LogBoxButton>\n );\n}\n\nconst headerStyles = StyleSheet.create({\n button: {\n alignItems: \"center\",\n aspectRatio: 1,\n justifyContent: \"center\",\n marginTop: 5,\n marginRight: 6,\n marginLeft: 6,\n marginBottom: Platform.select({\n web: 0,\n default: -8,\n }),\n borderRadius: 3,\n },\n buttonImage: {\n height: 14,\n width: 8,\n tintColor: LogBoxStyle.getTextColor(),\n },\n});\n\nconst styles = StyleSheet.create({\n syntax: {\n backgroundColor: LogBoxStyle.getFatalColor(),\n },\n static: {\n backgroundColor: LogBoxStyle.getFatalColor(),\n },\n fatal: {\n backgroundColor: LogBoxStyle.getFatalColor(),\n },\n warn: {\n backgroundColor: LogBoxStyle.getWarningColor(),\n },\n error: {\n backgroundColor: LogBoxStyle.getErrorColor(),\n },\n header: {\n flexDirection: \"row\",\n height: Platform.select({\n default: 48,\n ios: 44,\n }),\n },\n title: {\n alignItems: \"center\",\n flex: 1,\n justifyContent: \"center\",\n },\n titleText: {\n color: LogBoxStyle.getTextColor(),\n fontSize: 16,\n fontWeight: \"600\",\n includeFontPadding: false,\n lineHeight: 20,\n },\n safeArea: {\n paddingTop: Platform.OS !== \"ios\" ? StatusBar.currentHeight : 40,\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorMessageHeader.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorMessageHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAsD;AAItD,uDAAoD;AACpD,+DAAiD;AAUjD,MAAM,wBAAwB,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ACD,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;QAClC,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,KAAK;QACjB,iBAAiB,EAAE,EAAE;QACrB,aAAa,EAAE,EAAE;KAClB;IACD,OAAO,EAAE;QACP,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,EAAE;QACrB,SAAS,EAAE,EAAE;QACb,YAAY,EAAE,CAAC;KAChB;IACD,WAAW,EAAE;QACX,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC;KACtC;IACD,KAAK,EAAE;QACL,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;KACpC;IACD,KAAK,EAAE;QACL,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;KACpC;IACD,MAAM,EAAE;QACN,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;KACpC;IACD,WAAW,EAAE;QACX,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;KACrC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,EAAE;KACf;IACD,MAAM,EAAE;QACN,eAAe,EAAE,CAAC;QAClB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport type { LogLevel } from \"../Data/LogBoxLog\";\nimport type { Message } from \"../Data/parseLogBoxLog\";\nimport { LogBoxMessage } from \"../UI/LogBoxMessage\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\n\ntype Props = {\n collapsed: boolean;\n message: Message;\n level: LogLevel;\n title: string;\n onPress: () => void;\n};\n\nconst SHOW_MORE_MESSAGE_LENGTH = 300;\n\nfunction ShowMoreButton({\n message,\n collapsed,\n onPress,\n}: Pick<Props, \"collapsed\" | \"message\" | \"onPress\">) {\n if (message.content.length < SHOW_MORE_MESSAGE_LENGTH || !collapsed) {\n return null;\n }\n return (\n <Text style={styles.collapse} onPress={onPress}>\n ... See More\n </Text>\n );\n}\n\nexport function LogBoxInspectorMessageHeader(props: Props) {\n return (\n <View style={styles.body}>\n <View style={styles.heading}>\n <Text style={[styles.headingText, styles[props.level]]}>\n {props.title}\n </Text>\n </View>\n <Text style={styles.bodyText}>\n <LogBoxMessage\n maxLength={props.collapsed ? SHOW_MORE_MESSAGE_LENGTH : Infinity}\n message={props.message}\n style={styles.messageText}\n />\n <ShowMoreButton {...props} />\n </Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n body: {\n backgroundColor: LogBoxStyle.getBackgroundColor(1),\n shadowColor: \"#000\",\n shadowOffset: { width: 0, height: 2 },\n shadowRadius: 2,\n shadowOpacity: 0.5,\n // flex: 0,\n },\n bodyText: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 20,\n fontWeight: \"500\",\n paddingHorizontal: 12,\n paddingBottom: 10,\n },\n heading: {\n alignItems: \"center\",\n flexDirection: \"row\",\n paddingHorizontal: 12,\n marginTop: 10,\n marginBottom: 5,\n },\n headingText: {\n flex: 1,\n fontSize: 20,\n fontWeight: \"600\",\n includeFontPadding: false,\n lineHeight: 28,\n },\n warn: {\n color: LogBoxStyle.getWarningColor(1),\n },\n error: {\n color: LogBoxStyle.getErrorColor(1),\n },\n fatal: {\n color: LogBoxStyle.getFatalColor(1),\n },\n syntax: {\n color: LogBoxStyle.getFatalColor(1),\n },\n messageText: {\n color: LogBoxStyle.getTextColor(0.6),\n },\n collapse: {\n color: LogBoxStyle.getTextColor(0.7),\n fontSize: 14,\n fontWeight: \"300\",\n lineHeight: 12,\n },\n button: {\n paddingVertical: 5,\n paddingHorizontal: 10,\n borderRadius: 3,\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorMessageHeader.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorMessageHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAAsD;AAItD,uDAAoD;AACpD,+DAAiD;AAUjD,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAErC,SAAS,cAAc,CAAC,EACtB,OAAO,EACP,SAAS,EACT,OAAO,GAC0C;IACjD,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,wBAAwB,IAAI,CAAC,SAAS,EAAE;QACnE,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,mBAEvC,CACR,CAAC;AACJ,CAAC;AAED,SAAgB,4BAA4B,CAAC,KAAY;IACvD,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI;QACtB,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO;YACzB,8BAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IACnD,KAAK,CAAC,KAAK,CACP,CACF;QACP,8BAAC,mBAAI,IAAC,K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AAC,CAAC,CAAC;KACpC;IACD,KAAK,EAAE;QACL,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;KACpC;IACD,MAAM,EAAE;QACN,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;KACpC;IACD,MAAM,EAAE;QACN,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;KACpC;IACD,WAAW,EAAE;QACX,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;KACrC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,EAAE;KACf;IACD,MAAM,EAAE;QACN,eAAe,EAAE,CAAC;QAClB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport type { LogLevel } from \"../Data/LogBoxLog\";\nimport type { Message } from \"../Data/parseLogBoxLog\";\nimport { LogBoxMessage } from \"../UI/LogBoxMessage\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\n\ntype Props = {\n collapsed: boolean;\n message: Message;\n level: LogLevel;\n title: string;\n onPress: () => void;\n};\n\nconst SHOW_MORE_MESSAGE_LENGTH = 300;\n\nfunction ShowMoreButton({\n message,\n collapsed,\n onPress,\n}: Pick<Props, \"collapsed\" | \"message\" | \"onPress\">) {\n if (message.content.length < SHOW_MORE_MESSAGE_LENGTH || !collapsed) {\n return null;\n }\n return (\n <Text style={styles.collapse} onPress={onPress}>\n ... See More\n </Text>\n );\n}\n\nexport function LogBoxInspectorMessageHeader(props: Props) {\n return (\n <View style={styles.body}>\n <View style={styles.heading}>\n <Text style={[styles.headingText, styles[props.level]]}>\n {props.title}\n </Text>\n </View>\n <Text style={styles.bodyText}>\n <LogBoxMessage\n maxLength={props.collapsed ? SHOW_MORE_MESSAGE_LENGTH : Infinity}\n message={props.message}\n style={styles.messageText}\n />\n <ShowMoreButton {...props} />\n </Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n body: {\n backgroundColor: LogBoxStyle.getBackgroundColor(1),\n shadowColor: \"#000\",\n shadowOffset: { width: 0, height: 2 },\n shadowRadius: 2,\n shadowOpacity: 0.5,\n // flex: 0,\n },\n bodyText: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 20,\n fontWeight: \"500\",\n paddingHorizontal: 12,\n paddingBottom: 10,\n },\n heading: {\n alignItems: \"center\",\n flexDirection: \"row\",\n paddingHorizontal: 12,\n marginTop: 10,\n marginBottom: 5,\n },\n headingText: {\n flex: 1,\n fontSize: 20,\n fontWeight: \"600\",\n includeFontPadding: false,\n lineHeight: 28,\n },\n warn: {\n color: LogBoxStyle.getWarningColor(1),\n },\n error: {\n color: LogBoxStyle.getErrorColor(1),\n },\n fatal: {\n color: LogBoxStyle.getFatalColor(1),\n },\n syntax: {\n color: LogBoxStyle.getFatalColor(1),\n },\n static: {\n color: LogBoxStyle.getFatalColor(1),\n },\n messageText: {\n color: LogBoxStyle.getTextColor(0.6),\n },\n collapse: {\n color: LogBoxStyle.getTextColor(0.7),\n fontSize: 14,\n fontWeight: \"300\",\n lineHeight: 12,\n },\n button: {\n paddingVertical: 5,\n paddingHorizontal: 10,\n borderRadius: 3,\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorStackFrame.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorStackFrame.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAA0B,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorStackFrame.d.ts","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorStackFrame.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAA0B,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAS/C,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,UAAU,GAAG;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC3C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,KAAK,eA6BrD"}
|
|
@@ -42,13 +42,7 @@ const constants_1 = require("../UI/constants");
|
|
|
42
42
|
const formatProjectFilePath_1 = require("../formatProjectFilePath");
|
|
43
43
|
function LogBoxInspectorStackFrame(props) {
|
|
44
44
|
const { frame, onPress } = props;
|
|
45
|
-
const
|
|
46
|
-
const location = (0, formatProjectFilePath_1.formatProjectFileName)(frame.file) +
|
|
47
|
-
(frame.lineNumber != null
|
|
48
|
-
? ":" +
|
|
49
|
-
frame.lineNumber +
|
|
50
|
-
(column && !isNaN(column) ? ":" + (column + 1) : "")
|
|
51
|
-
: "");
|
|
45
|
+
const location = (0, formatProjectFilePath_1.getStackFormattedLocation)(process.env.EXPO_PROJECT_ROOT, frame);
|
|
52
46
|
return (react_1.default.createElement(react_native_1.View, { style: styles.frameContainer },
|
|
53
47
|
react_1.default.createElement(LogBoxButton_1.LogBoxButton, { backgroundColor: {
|
|
54
48
|
default: "transparent",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogBoxInspectorStackFrame.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorStackFrame.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAA6E;AAG7E,qDAAkD;AAClD,+DAAiD;AACjD,+CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"LogBoxInspectorStackFrame.js","sourceRoot":"","sources":["../../../src/error-overlay/overlay/LogBoxInspectorStackFrame.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,kDAA0B;AAC1B,+CAA6E;AAG7E,qDAAkD;AAClD,+DAAiD;AACjD,+CAA4C;AAC5C,oEAAqE;AASrE,SAAgB,yBAAyB,CAAC,KAAY;IACpD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,QAAQ,GAAG,IAAA,iDAAyB,EACxC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAC7B,KAAK,CACN,CAAC;IACF,OAAO,CACL,8BAAC,mBAAI,IAAC,KAAK,EAAE,MAAM,CAAC,cAAc;QAChC,8BAAC,2BAAY,IACX,eAAe,EAAE;gBACf,OAAO,EAAE,aAAa;gBACtB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa;aACrE,EACD,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,CAAC,KAAK;YAEnB,8BAAC,mBAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,IAC9D,KAAK,CAAC,UAAU,CACZ;YACP,8BAAC,mBAAI,IACH,aAAa,EAAC,QAAQ,EACtB,aAAa,EAAE,CAAC,EAChB,KAAK,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,IAE9D,QAAQ,CACJ,CACM,CACV,CACR,CAAC;AACJ,CAAC;AA7BD,8DA6BC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,cAAc,EAAE;QACd,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,EAAE;KACtB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,CAAC;QAClB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;IACD,YAAY,EAAE;QACZ,aAAa,EAAE,KAAK;KACrB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;QAClC,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,qBAAS;KACtB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,EAAE;KAChB;IACD,GAAG,EAAE;QACH,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,UAAU,EAAE,KAAK;KAClB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC;QACpC,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAAE,EAAE;KACf;CACF,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Evan Bacon.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from \"react\";\nimport { GestureResponderEvent, StyleSheet, Text, View } from \"react-native\";\nimport { StackFrame } from \"stacktrace-parser\";\n\nimport { LogBoxButton } from \"../UI/LogBoxButton\";\nimport * as LogBoxStyle from \"../UI/LogBoxStyle\";\nimport { CODE_FONT } from \"../UI/constants\";\nimport { getStackFormattedLocation } from \"../formatProjectFilePath\";\n\ndeclare const process: any;\n\ntype Props = {\n frame: StackFrame & { collapse?: boolean };\n onPress?: (event: GestureResponderEvent) => void;\n};\n\nexport function LogBoxInspectorStackFrame(props: Props) {\n const { frame, onPress } = props;\n const location = getStackFormattedLocation(\n process.env.EXPO_PROJECT_ROOT,\n frame\n );\n return (\n <View style={styles.frameContainer}>\n <LogBoxButton\n backgroundColor={{\n default: \"transparent\",\n pressed: onPress ? LogBoxStyle.getBackgroundColor(1) : \"transparent\",\n }}\n onPress={onPress}\n style={styles.frame}\n >\n <Text style={[styles.name, frame.collapse === true && styles.dim]}>\n {frame.methodName}\n </Text>\n <Text\n ellipsizeMode=\"middle\"\n numberOfLines={1}\n style={[styles.location, frame.collapse === true && styles.dim]}\n >\n {location}\n </Text>\n </LogBoxButton>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n frameContainer: {\n flexDirection: \"row\",\n paddingHorizontal: 15,\n },\n frame: {\n flex: 1,\n paddingVertical: 4,\n paddingHorizontal: 10,\n borderRadius: 5,\n },\n lineLocation: {\n flexDirection: \"row\",\n },\n name: {\n color: LogBoxStyle.getTextColor(1),\n fontSize: 14,\n includeFontPadding: false,\n lineHeight: 18,\n fontWeight: \"400\",\n fontFamily: CODE_FONT,\n },\n location: {\n color: LogBoxStyle.getTextColor(0.8),\n fontSize: 12,\n fontWeight: \"300\",\n includeFontPadding: false,\n lineHeight: 16,\n paddingLeft: 10,\n },\n dim: {\n color: LogBoxStyle.getTextColor(0.4),\n fontWeight: \"300\",\n },\n line: {\n color: LogBoxStyle.getTextColor(0.8),\n fontSize: 12,\n fontWeight: \"300\",\n includeFontPadding: false,\n lineHeight: 16,\n },\n});\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LogBoxLog } from "./error-overlay/Data/LogBoxLog";
|
|
2
|
+
import parseErrorStack from "./error-overlay/modules/parseErrorStack";
|
|
3
|
+
export { LogBoxLog, parseErrorStack };
|
|
4
|
+
export * from "./error-overlay/formatProjectFilePath";
|
|
5
|
+
//# sourceMappingURL=symbolicate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbolicate.d.ts","sourceRoot":"","sources":["../src/symbolicate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,eAAe,MAAM,yCAAyC,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAEtC,cAAc,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.parseErrorStack = exports.LogBoxLog = void 0;
|
|
21
|
+
const LogBoxLog_1 = require("./error-overlay/Data/LogBoxLog");
|
|
22
|
+
Object.defineProperty(exports, "LogBoxLog", { enumerable: true, get: function () { return LogBoxLog_1.LogBoxLog; } });
|
|
23
|
+
const parseErrorStack_1 = __importDefault(require("./error-overlay/modules/parseErrorStack"));
|
|
24
|
+
exports.parseErrorStack = parseErrorStack_1.default;
|
|
25
|
+
__exportStar(require("./error-overlay/formatProjectFilePath"), exports);
|
|
26
|
+
//# sourceMappingURL=symbolicate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbolicate.js","sourceRoot":"","sources":["../src/symbolicate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,8DAA2D;AAGlD,0FAHA,qBAAS,OAGA;AAFlB,8FAAsE;AAElD,0BAFb,yBAAe,CAEa;AAEnC,wEAAsD","sourcesContent":["import { LogBoxLog } from \"./error-overlay/Data/LogBoxLog\";\nimport parseErrorStack from \"./error-overlay/modules/parseErrorStack\";\n\nexport { LogBoxLog, parseErrorStack };\n\nexport * from \"./error-overlay/formatProjectFilePath\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/metro-runtime",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Tools for making experimental Metro bundler features work",
|
|
5
5
|
"main": "build",
|
|
6
6
|
"homepage": "https://github.com/expo/router/tree/main/packages/expo-metro-runtime",
|
|
7
7
|
"files": [
|
|
8
8
|
"build",
|
|
9
|
+
"symbolicate",
|
|
9
10
|
"async-require.js",
|
|
10
11
|
"async-require.d.ts",
|
|
11
12
|
"error-overlay.js",
|
|
12
13
|
"error-overlay.d.ts",
|
|
13
14
|
"transformer.js",
|
|
14
15
|
"transformer.d.ts",
|
|
15
|
-
"assets"
|
|
16
|
+
"assets",
|
|
17
|
+
"!**/__tests__"
|
|
16
18
|
],
|
|
17
19
|
"scripts": {
|
|
18
20
|
"build": "expo-module build",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../build/symbolicate";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../build/symbolicate");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildAsyncRequire.test.d.ts","sourceRoot":"","sources":["../../../src/async-require/__tests__/buildAsyncRequire.test.ts"],"names":[],"mappings":";AAGA,eAAO,MAAM,MAAM,uBAAwB,GAAG,EAAE,KAAK,GAAG,kCAEC,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.asMock = void 0;
|
|
4
|
-
const buildAsyncRequire_1 = require("../buildAsyncRequire");
|
|
5
|
-
const loadBundle_1 = require("../loadBundle");
|
|
6
|
-
const asMock = (fn) => fn;
|
|
7
|
-
exports.asMock = asMock;
|
|
8
|
-
jest.mock("../loadBundle", () => ({
|
|
9
|
-
loadBundleAsync: jest.fn(async () => { }),
|
|
10
|
-
}));
|
|
11
|
-
function getMockRequire() {
|
|
12
|
-
const mockRequire = jest.fn();
|
|
13
|
-
mockRequire.importAll = jest.fn();
|
|
14
|
-
return mockRequire;
|
|
15
|
-
}
|
|
16
|
-
const originalEnv = process.env.NODE_ENV;
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
process.env.NODE_ENV = "development";
|
|
19
|
-
});
|
|
20
|
-
afterAll(() => {
|
|
21
|
-
process.env.NODE_ENV = originalEnv;
|
|
22
|
-
});
|
|
23
|
-
it(`builds required object`, async () => {
|
|
24
|
-
const _require = getMockRequire();
|
|
25
|
-
const asyncRequire = (0, buildAsyncRequire_1.buildAsyncRequire)(_require);
|
|
26
|
-
expect(asyncRequire).toBeInstanceOf(Function);
|
|
27
|
-
expect(asyncRequire.prefetch).toBeInstanceOf(Function);
|
|
28
|
-
expect(asyncRequire.resource).toBeInstanceOf(Function);
|
|
29
|
-
});
|
|
30
|
-
it(`loads the module with \`loadBundleAsync\` if the module has not been loaded already`, async () => {
|
|
31
|
-
const _require = getMockRequire();
|
|
32
|
-
const asyncRequire = (0, buildAsyncRequire_1.buildAsyncRequire)(_require);
|
|
33
|
-
const myModule = asyncRequire(650, "", { "650": "SixFiveZero" });
|
|
34
|
-
expect(myModule).toEqual(expect.any(Promise));
|
|
35
|
-
// Did attempt to fetch the bundle
|
|
36
|
-
expect(loadBundle_1.loadBundleAsync).toBeCalledWith("SixFiveZero");
|
|
37
|
-
expect(_require.importAll).not.toBeCalled();
|
|
38
|
-
});
|
|
39
|
-
it(`fetches and returns an async module`, async () => {
|
|
40
|
-
const _require = getMockRequire();
|
|
41
|
-
(0, exports.asMock)(_require).mockReturnValueOnce({ foo: "bar" });
|
|
42
|
-
const asyncRequire = (0, buildAsyncRequire_1.buildAsyncRequire)(_require);
|
|
43
|
-
expect(asyncRequire).toBeInstanceOf(Function);
|
|
44
|
-
const myModule = await asyncRequire(2, "", {
|
|
45
|
-
"2": "Two",
|
|
46
|
-
});
|
|
47
|
-
// Fetch and load the bundle into memory.
|
|
48
|
-
expect(loadBundle_1.loadBundleAsync).toBeCalledWith("Two");
|
|
49
|
-
// Ensure the module was required using Metro after the bundle was loaded.
|
|
50
|
-
expect(_require).toBeCalledWith(2);
|
|
51
|
-
// Ensure the module was returned.
|
|
52
|
-
expect(myModule).toEqual({ foo: "bar" });
|
|
53
|
-
});
|
|
54
|
-
it(`disables async requires in production`, async () => {
|
|
55
|
-
process.env.NODE_ENV = "production";
|
|
56
|
-
const _require = getMockRequire();
|
|
57
|
-
(0, exports.asMock)(_require.importAll).mockReturnValueOnce({ foo: "bar" });
|
|
58
|
-
const asyncRequire = (0, buildAsyncRequire_1.buildAsyncRequire)(_require);
|
|
59
|
-
expect(asyncRequire).toBeInstanceOf(Function);
|
|
60
|
-
const myModule = await asyncRequire(2, "", {
|
|
61
|
-
"2": "Two",
|
|
62
|
-
});
|
|
63
|
-
// Fetch and load the bundle into memory.
|
|
64
|
-
expect(loadBundle_1.loadBundleAsync).not.toBeCalled();
|
|
65
|
-
// Ensure the module was required using Metro after the bundle was loaded.
|
|
66
|
-
expect(_require.importAll).toBeCalledWith(2);
|
|
67
|
-
expect(_require).not.toBeCalled();
|
|
68
|
-
// Ensure the module was returned.
|
|
69
|
-
expect(myModule).toEqual({ foo: "bar" });
|
|
70
|
-
});
|
|
71
|
-
//# sourceMappingURL=buildAsyncRequire.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildAsyncRequire.test.js","sourceRoot":"","sources":["../../../src/async-require/__tests__/buildAsyncRequire.test.ts"],"names":[],"mappings":";;;AAAA,4DAAyD;AACzD,8CAAgD;AAEzC,MAAM,MAAM,GAAG,CACpB,EAAK,EACmB,EAAE,CAAC,EAA4B,CAAC;AAF7C,QAAA,MAAM,UAEuC;AAE1D,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC;IAChC,eAAe,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,GAAE,CAAC,CAAC;CACzC,CAAC,CAAC,CAAC;AAEJ,SAAS,cAAc;IACrB,MAAM,WAAW,GAAQ,IAAI,CAAC,EAAE,EAAE,CAAC;IACnC,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAElC,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AACzC,UAAU,CAAC,GAAG,EAAE;IACd,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;AACvC,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,GAAG,EAAE;IACZ,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,WAAW,CAAC;AACrC,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;IAC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AG,EAAE,KAAK,EAAE,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC","sourcesContent":["import { buildAsyncRequire } from \"../buildAsyncRequire\";\nimport { loadBundleAsync } from \"../loadBundle\";\n\nexport const asMock = <T extends (...args: any[]) => any>(\n fn: T\n): jest.MockedFunction<T> => fn as jest.MockedFunction<T>;\n\njest.mock(\"../loadBundle\", () => ({\n loadBundleAsync: jest.fn(async () => {}),\n}));\n\nfunction getMockRequire() {\n const mockRequire: any = jest.fn();\n mockRequire.importAll = jest.fn();\n\n return mockRequire;\n}\n\nconst originalEnv = process.env.NODE_ENV;\nbeforeEach(() => {\n process.env.NODE_ENV = \"development\";\n});\n\nafterAll(() => {\n process.env.NODE_ENV = originalEnv;\n});\n\nit(`builds required object`, async () => {\n const _require = getMockRequire();\n const asyncRequire = buildAsyncRequire(_require);\n\n expect(asyncRequire).toBeInstanceOf(Function);\n expect(asyncRequire.prefetch).toBeInstanceOf(Function);\n expect(asyncRequire.resource).toBeInstanceOf(Function);\n});\n\nit(`loads the module with \\`loadBundleAsync\\` if the module has not been loaded already`, async () => {\n const _require = getMockRequire();\n const asyncRequire = buildAsyncRequire(_require);\n\n const myModule = asyncRequire(650, \"\", { \"650\": \"SixFiveZero\" });\n expect(myModule).toEqual(expect.any(Promise));\n\n // Did attempt to fetch the bundle\n expect(loadBundleAsync).toBeCalledWith(\"SixFiveZero\");\n expect(_require.importAll).not.toBeCalled();\n});\n\nit(`fetches and returns an async module`, async () => {\n const _require = getMockRequire();\n\n asMock(_require).mockReturnValueOnce({ foo: \"bar\" });\n\n const asyncRequire = buildAsyncRequire(_require);\n\n expect(asyncRequire).toBeInstanceOf(Function);\n\n const myModule = await asyncRequire(2, \"\", {\n \"2\": \"Two\",\n });\n\n // Fetch and load the bundle into memory.\n expect(loadBundleAsync).toBeCalledWith(\"Two\");\n\n // Ensure the module was required using Metro after the bundle was loaded.\n expect(_require).toBeCalledWith(2);\n\n // Ensure the module was returned.\n expect(myModule).toEqual({ foo: \"bar\" });\n});\n\nit(`disables async requires in production`, async () => {\n process.env.NODE_ENV = \"production\";\n const _require = getMockRequire();\n\n asMock(_require.importAll).mockReturnValueOnce({ foo: \"bar\" });\n\n const asyncRequire = buildAsyncRequire(_require);\n\n expect(asyncRequire).toBeInstanceOf(Function);\n\n const myModule = await asyncRequire(2, \"\", {\n \"2\": \"Two\",\n });\n\n // Fetch and load the bundle into memory.\n expect(loadBundleAsync).not.toBeCalled();\n\n // Ensure the module was required using Metro after the bundle was loaded.\n expect(_require.importAll).toBeCalledWith(2);\n expect(_require).not.toBeCalled();\n\n // Ensure the module was returned.\n expect(myModule).toEqual({ foo: \"bar\" });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildUrlForBundle.test.native.d.ts","sourceRoot":"","sources":["../../../src/async-require/__tests__/buildUrlForBundle.test.native.ts"],"names":[],"mappings":";AAGA,eAAO,MAAM,MAAM,uBAAwB,GAAG,EAAE,KAAK,GAAG,kCAEC,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
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.asMock = void 0;
|
|
7
|
-
const getDevServer_1 = __importDefault(require("../../getDevServer"));
|
|
8
|
-
const buildUrlForBundle_1 = require("../buildUrlForBundle");
|
|
9
|
-
const asMock = (fn) => fn;
|
|
10
|
-
exports.asMock = asMock;
|
|
11
|
-
jest.mock("../../getDevServer", () => {
|
|
12
|
-
return jest.fn();
|
|
13
|
-
});
|
|
14
|
-
it(`returns an expected URL`, () => {
|
|
15
|
-
(0, exports.asMock)(getDevServer_1.default).mockReturnValueOnce({
|
|
16
|
-
bundleLoadedFromServer: true,
|
|
17
|
-
fullBundleUrl: "http://localhost:19000?platform=android&modulesOnly=true&runModule=false&runtimeBytecodeVersion=null",
|
|
18
|
-
url: "http://localhost:19000",
|
|
19
|
-
});
|
|
20
|
-
expect((0, buildUrlForBundle_1.buildUrlForBundle)("/foobar", {})).toEqual("http://localhost:19000/foobar.bundle?platform=android&modulesOnly=true&runModule=false&runtimeBytecodeVersion=null");
|
|
21
|
-
});
|
|
22
|
-
it(`returns an expected URL with extra parameters`, () => {
|
|
23
|
-
(0, exports.asMock)(getDevServer_1.default).mockReturnValueOnce({
|
|
24
|
-
bundleLoadedFromServer: true,
|
|
25
|
-
fullBundleUrl: "http://localhost:19000?platform=android",
|
|
26
|
-
url: "http://localhost:19000",
|
|
27
|
-
});
|
|
28
|
-
expect((0, buildUrlForBundle_1.buildUrlForBundle)("/more/than/one", { happy: "meal" })).toEqual("http://localhost:19000/more/than/one.bundle?platform=android&happy=meal");
|
|
29
|
-
});
|
|
30
|
-
it("throws on native when the bundle is not hosted", () => {
|
|
31
|
-
(0, exports.asMock)(getDevServer_1.default).mockReturnValueOnce({
|
|
32
|
-
bundleLoadedFromServer: false,
|
|
33
|
-
fullBundleUrl: "file://",
|
|
34
|
-
url: "file://",
|
|
35
|
-
});
|
|
36
|
-
expect(() => (0, buildUrlForBundle_1.buildUrlForBundle)("foobar", {})).toThrowErrorMatchingInlineSnapshot(`"This bundle was compiled with 'transformer.experimentalImportBundleSupport' in the 'metro.config.js' and can only be used when connected to a Metro server."`);
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=buildUrlForBundle.test.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildUrlForBundle.test.native.js","sourceRoot":"","sources":["../../../src/async-require/__tests__/buildUrlForBundle.test.native.ts"],"names":[],"mappings":";;;;;;AAAA,sEAA8C;AAC9C,4DAAyD;AAElD,MAAM,MAAM,GAAG,CACpB,EAAK,EACmB,EAAE,CAAC,EAA4B,CAAC;AAF7C,QAAA,MAAM,UAEuC;AAE1D,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,GAAG,EAAE;IACnC,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC;AACnB,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACjC,IAAA,cAAM,EAAC,sBAAY,CAAC,CAAC,mBAAmB,CAAC;QACvC,sBAAsB,EAAE,IAAI;QAC5B,aAAa,EACX,sGAAsG;QACxG,GAAG,EAAE,wBAAwB;KAC9B,CAAC,CAAC;IAEH,MAAM,CAAC,IAAA,qCAAiB,EAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAC9C,oHAAoH,CACrH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;IACvD,IAAA,cAAM,EAAC,sBAAY,CAAC,CAAC,mBAAmB,CAAC;QACvC,sBAAsB,EAAE,IAAI;QAC5B,aAAa,EAAE,yCAAyC;QACxD,GAAG,EAAE,wBAAwB;KAC9B,CAAC,CAAC;IAEH,MAAM,CAAC,IAAA,qCAAiB,EAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CACpE,yEAAyE,CAC1E,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;IACxD,IAAA,cAAM,EAAC,sBAAY,CAAC,CAAC,mBAAmB,CAAC;QACvC,sBAAsB,EAAE,KAAK;QAC7B,aAAa,EAAE,SAAS;QACxB,GAAG,EAAE,SAAS;KACf,CAAC,CAAC;IAEH,MAAM,CAAC,GAAG,EAAE,CACV,IAAA,qCAAiB,EAAC,QAAQ,EAAE,EAAE,CAAC,CAChC,CAAC,kCAAkC,CAClC,+JAA+J,CAChK,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import getDevServer from \"../../getDevServer\";\nimport { buildUrlForBundle } from \"../buildUrlForBundle\";\n\nexport const asMock = <T extends (...args: any[]) => any>(\n fn: T\n): jest.MockedFunction<T> => fn as jest.MockedFunction<T>;\n\njest.mock(\"../../getDevServer\", () => {\n return jest.fn();\n});\n\nit(`returns an expected URL`, () => {\n asMock(getDevServer).mockReturnValueOnce({\n bundleLoadedFromServer: true,\n fullBundleUrl:\n \"http://localhost:19000?platform=android&modulesOnly=true&runModule=false&runtimeBytecodeVersion=null\",\n url: \"http://localhost:19000\",\n });\n\n expect(buildUrlForBundle(\"/foobar\", {})).toEqual(\n \"http://localhost:19000/foobar.bundle?platform=android&modulesOnly=true&runModule=false&runtimeBytecodeVersion=null\"\n );\n});\n\nit(`returns an expected URL with extra parameters`, () => {\n asMock(getDevServer).mockReturnValueOnce({\n bundleLoadedFromServer: true,\n fullBundleUrl: \"http://localhost:19000?platform=android\",\n url: \"http://localhost:19000\",\n });\n\n expect(buildUrlForBundle(\"/more/than/one\", { happy: \"meal\" })).toEqual(\n \"http://localhost:19000/more/than/one.bundle?platform=android&happy=meal\"\n );\n});\n\nit(\"throws on native when the bundle is not hosted\", () => {\n asMock(getDevServer).mockReturnValueOnce({\n bundleLoadedFromServer: false,\n fullBundleUrl: \"file://\",\n url: \"file://\",\n });\n\n expect(() =>\n buildUrlForBundle(\"foobar\", {})\n ).toThrowErrorMatchingInlineSnapshot(\n `\"This bundle was compiled with 'transformer.experimentalImportBundleSupport' in the 'metro.config.js' and can only be used when connected to a Metro server.\"`\n );\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildUrlForBundle.test.web.d.ts","sourceRoot":"","sources":["../../../src/async-require/__tests__/buildUrlForBundle.test.web.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const buildUrlForBundle_1 = require("../buildUrlForBundle");
|
|
4
|
-
it(`returns an expected URL with no params`, () => {
|
|
5
|
-
expect((0, buildUrlForBundle_1.buildUrlForBundle)("/foobar", {})).toEqual("/foobar.bundle");
|
|
6
|
-
});
|
|
7
|
-
it(`returns an expected URL with params`, () => {
|
|
8
|
-
expect((0, buildUrlForBundle_1.buildUrlForBundle)("foobar", { platform: "web" })).toEqual("/foobar.bundle?platform=web");
|
|
9
|
-
});
|
|
10
|
-
it(`returns an expected URL with non standard root`, () => {
|
|
11
|
-
expect((0, buildUrlForBundle_1.buildUrlForBundle)("/more/than/one", { happy: "meal" })).toEqual("/more/than/one.bundle?happy=meal");
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=buildUrlForBundle.test.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildUrlForBundle.test.web.js","sourceRoot":"","sources":["../../../src/async-require/__tests__/buildUrlForBundle.test.web.ts"],"names":[],"mappings":";;AAAA,4DAAyD;AAEzD,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;IAChD,MAAM,CAAC,IAAA,qCAAiB,EAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACrE,CAAC,CAAC,CAAC;AACH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;IAC7C,MAAM,CAAC,IAAA,qCAAiB,EAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAC9D,6BAA6B,CAC9B,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;IACxD,MAAM,CAAC,IAAA,qCAAiB,EAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CACpE,kCAAkC,CACnC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { buildUrlForBundle } from \"../buildUrlForBundle\";\n\nit(`returns an expected URL with no params`, () => {\n expect(buildUrlForBundle(\"/foobar\", {})).toEqual(\"/foobar.bundle\");\n});\nit(`returns an expected URL with params`, () => {\n expect(buildUrlForBundle(\"foobar\", { platform: \"web\" })).toEqual(\n \"/foobar.bundle?platform=web\"\n );\n});\nit(`returns an expected URL with non standard root`, () => {\n expect(buildUrlForBundle(\"/more/than/one\", { happy: \"meal\" })).toEqual(\n \"/more/than/one.bundle?happy=meal\"\n );\n});\n"]}
|