@expo/require-utils 56.1.4-canary-20260624-9d83b81 → 57.0.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/checks.js +2 -2
- package/build/checks.js.map +1 -1
- package/build/codeframe.js +75 -84
- package/build/codeframe.js.map +1 -1
- package/build/index.js +36 -20
- package/build/index.js.map +1 -1
- package/build/load.js +313 -357
- package/build/load.js.map +1 -1
- package/build/resolve.js +151 -150
- package/build/resolve.js.map +1 -1
- package/build/resolveGlobal.d.ts +3 -1
- package/build/resolveGlobal.js +136 -166
- package/build/resolveGlobal.js.map +1 -1
- package/build/stacktrace.js +230 -244
- package/build/stacktrace.js.map +1 -1
- package/build/transform.js +24 -34
- package/build/transform.js.map +1 -1
- package/package.json +7 -18
package/build/checks.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=checks.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
//# sourceMappingURL=checks.js.map
|
package/build/checks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"checks.js","names":[],"sources":["../src/checks.ts"],"sourcesContent":[""],"mappings":"","ignoreList":[]}
|
package/build/codeframe.js
CHANGED
|
@@ -1,98 +1,89 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
});
|
|
5
|
-
0 && (module.exports = {
|
|
6
|
-
annotateError: null,
|
|
7
|
-
formatDiagnostic: null
|
|
4
|
+
value: true
|
|
8
5
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
_export(exports, {
|
|
16
|
-
get annotateError () {
|
|
17
|
-
return annotateError;
|
|
18
|
-
},
|
|
19
|
-
get formatDiagnostic () {
|
|
20
|
-
return formatDiagnostic;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
function _nodeurl() {
|
|
24
|
-
const data = /*#__PURE__*/ _interop_require_default(require("node:url"));
|
|
25
|
-
_nodeurl = function() {
|
|
26
|
-
return data;
|
|
27
|
-
};
|
|
6
|
+
exports.annotateError = annotateError;
|
|
7
|
+
exports.formatDiagnostic = formatDiagnostic;
|
|
8
|
+
function _nodeUrl() {
|
|
9
|
+
const data = _interopRequireDefault(require("node:url"));
|
|
10
|
+
_nodeUrl = function () {
|
|
28
11
|
return data;
|
|
12
|
+
};
|
|
13
|
+
return data;
|
|
29
14
|
}
|
|
30
|
-
function
|
|
31
|
-
return obj && obj.__esModule ? obj : {
|
|
32
|
-
default: obj
|
|
33
|
-
};
|
|
34
|
-
}
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
35
16
|
function errorToLoc(filename, error) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
17
|
+
if (error.name === 'ReferenceError' || error.name === 'SyntaxError') {
|
|
18
|
+
let stack = `${error.stack || ''}`;
|
|
19
|
+
stack = stack.slice(error.name.length + 2 /* '${name}: ' prefix */);
|
|
20
|
+
stack = stack.slice(error.message.length);
|
|
21
|
+
const trace = stack.match(/at ([^\n]+):(\d+):(\d+)/m);
|
|
22
|
+
if (_nodeUrl().default.pathToFileURL(filename).href === trace?.[1]) {
|
|
23
|
+
const line = Number(trace[2]);
|
|
24
|
+
return Number.isSafeInteger(line) ? {
|
|
25
|
+
line,
|
|
26
|
+
column: Number(trace[3]) || undefined
|
|
27
|
+
} : null;
|
|
48
28
|
}
|
|
49
|
-
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
50
31
|
}
|
|
51
32
|
function formatDiagnostic(diagnostic) {
|
|
52
|
-
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
const { start, file, messageText } = diagnostic;
|
|
56
|
-
if (file && messageText && start != null) {
|
|
57
|
-
const { codeFrameColumns } = require('@babel/code-frame');
|
|
58
|
-
const { line, character } = file.getLineAndCharacterOfPosition(start);
|
|
59
|
-
const loc = {
|
|
60
|
-
line: line + 1,
|
|
61
|
-
column: character + 1
|
|
62
|
-
};
|
|
63
|
-
const codeFrame = codeFrameColumns(file.getText(), {
|
|
64
|
-
start: loc
|
|
65
|
-
}, {
|
|
66
|
-
highlightCode: true
|
|
67
|
-
});
|
|
68
|
-
const annotatedError = new SyntaxError(`${messageText}\n${codeFrame}`);
|
|
69
|
-
annotatedError.codeFrame = codeFrame;
|
|
70
|
-
delete annotatedError.stack;
|
|
71
|
-
return annotatedError;
|
|
72
|
-
}
|
|
33
|
+
if (!diagnostic) {
|
|
73
34
|
return null;
|
|
35
|
+
}
|
|
36
|
+
const {
|
|
37
|
+
start,
|
|
38
|
+
file,
|
|
39
|
+
messageText
|
|
40
|
+
} = diagnostic;
|
|
41
|
+
if (file && messageText && start != null) {
|
|
42
|
+
const {
|
|
43
|
+
codeFrameColumns
|
|
44
|
+
} = require('@babel/code-frame');
|
|
45
|
+
const {
|
|
46
|
+
line,
|
|
47
|
+
character
|
|
48
|
+
} = file.getLineAndCharacterOfPosition(start);
|
|
49
|
+
const loc = {
|
|
50
|
+
line: line + 1,
|
|
51
|
+
column: character + 1
|
|
52
|
+
};
|
|
53
|
+
const codeFrame = codeFrameColumns(file.getText(), {
|
|
54
|
+
start: loc
|
|
55
|
+
}, {
|
|
56
|
+
highlightCode: true
|
|
57
|
+
});
|
|
58
|
+
const annotatedError = new SyntaxError(`${messageText}\n${codeFrame}`);
|
|
59
|
+
annotatedError.codeFrame = codeFrame;
|
|
60
|
+
delete annotatedError.stack;
|
|
61
|
+
return annotatedError;
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
74
64
|
}
|
|
75
65
|
function annotateError(code, filename, error) {
|
|
76
|
-
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
if (code) {
|
|
80
|
-
const loc = errorToLoc(filename, error);
|
|
81
|
-
if (loc) {
|
|
82
|
-
const { codeFrameColumns } = require('@babel/code-frame');
|
|
83
|
-
const codeFrame = codeFrameColumns(code, {
|
|
84
|
-
start: loc
|
|
85
|
-
}, {
|
|
86
|
-
highlightCode: true
|
|
87
|
-
});
|
|
88
|
-
const annotatedError = error;
|
|
89
|
-
annotatedError.codeFrame = codeFrame;
|
|
90
|
-
annotatedError.message += `\n${codeFrame}`;
|
|
91
|
-
delete annotatedError.stack;
|
|
92
|
-
return annotatedError;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
66
|
+
if (typeof error !== 'object' || error == null) {
|
|
95
67
|
return null;
|
|
68
|
+
}
|
|
69
|
+
if (code) {
|
|
70
|
+
const loc = errorToLoc(filename, error);
|
|
71
|
+
if (loc) {
|
|
72
|
+
const {
|
|
73
|
+
codeFrameColumns
|
|
74
|
+
} = require('@babel/code-frame');
|
|
75
|
+
const codeFrame = codeFrameColumns(code, {
|
|
76
|
+
start: loc
|
|
77
|
+
}, {
|
|
78
|
+
highlightCode: true
|
|
79
|
+
});
|
|
80
|
+
const annotatedError = error;
|
|
81
|
+
annotatedError.codeFrame = codeFrame;
|
|
82
|
+
annotatedError.message += `\n${codeFrame}`;
|
|
83
|
+
delete annotatedError.stack;
|
|
84
|
+
return annotatedError;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
96
88
|
}
|
|
97
|
-
|
|
98
|
-
//# sourceMappingURL=codeframe.js.map
|
|
89
|
+
//# sourceMappingURL=codeframe.js.map
|
package/build/codeframe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"codeframe.js","names":["_nodeUrl","data","_interopRequireDefault","require","e","__esModule","default","errorToLoc","filename","error","name","stack","slice","length","message","trace","match","url","pathToFileURL","href","line","Number","isSafeInteger","column","undefined","formatDiagnostic","diagnostic","start","file","messageText","codeFrameColumns","character","getLineAndCharacterOfPosition","loc","codeFrame","getText","highlightCode","annotatedError","SyntaxError","annotateError","code"],"sources":["../src/codeframe.ts"],"sourcesContent":["import url from 'node:url';\nimport type { Diagnostic } from 'typescript';\n\nfunction errorToLoc(filename: string, error: Error) {\n if (error.name === 'ReferenceError' || error.name === 'SyntaxError') {\n let stack = `${error.stack || ''}`;\n stack = stack.slice(error.name.length + 2 /* '${name}: ' prefix */);\n stack = stack.slice(error.message.length);\n const trace = stack.match(/at ([^\\n]+):(\\d+):(\\d+)/m);\n if (url.pathToFileURL(filename).href === trace?.[1]) {\n const line = Number(trace[2]);\n return Number.isSafeInteger(line) ? { line, column: Number(trace[3]) || undefined } : null;\n }\n }\n return null;\n}\n\nexport function formatDiagnostic(diagnostic: Diagnostic | undefined) {\n if (!diagnostic) {\n return null;\n }\n const { start, file, messageText } = diagnostic;\n if (file && messageText && start != null) {\n const { codeFrameColumns }: typeof import('@babel/code-frame') = require('@babel/code-frame');\n const { line, character } = file.getLineAndCharacterOfPosition(start);\n const loc = { line: line + 1, column: character + 1 };\n const codeFrame = codeFrameColumns(file.getText(), { start: loc }, { highlightCode: true });\n const annotatedError = new SyntaxError(`${messageText}\\n${codeFrame}`) as SyntaxError & {\n codeFrame: string;\n };\n annotatedError.codeFrame = codeFrame;\n delete annotatedError.stack;\n return annotatedError;\n }\n return null;\n}\n\nexport function annotateError(code: string | null, filename: string, error: Error) {\n if (typeof error !== 'object' || error == null) {\n return null;\n }\n if (code) {\n const loc = errorToLoc(filename, error);\n if (loc) {\n const { codeFrameColumns }: typeof import('@babel/code-frame') = require('@babel/code-frame');\n const codeFrame = codeFrameColumns(code, { start: loc }, { highlightCode: true });\n const annotatedError = error as Error & { codeFrame: string };\n annotatedError.codeFrame = codeFrame;\n annotatedError.message += `\\n${codeFrame}`;\n delete annotatedError.stack;\n return annotatedError;\n }\n }\n return null;\n}\n"],"mapp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D4B,cAAc,CAACH,SAAS,GAAGA,SAAS;MACpCG,cAAc,CAACvB,OAAO,IAAI,KAAKoB,SAAS,EAAE;MAC1C,OAAOG,cAAc,CAAC1B,KAAK;MAC3B,OAAO0B,cAAc;IACvB;EACF;EACA,OAAO,IAAI;AACb","ignoreList":[]}
|
package/build/index.js
CHANGED
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
+
value: true
|
|
4
5
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
var _load = require("./load");
|
|
7
|
+
Object.keys(_load).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _load[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _load[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _resolve = require("./resolve");
|
|
18
|
+
Object.keys(_resolve).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _resolve[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _resolve[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _resolveGlobal = require("./resolveGlobal");
|
|
29
|
+
Object.keys(_resolveGlobal).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _resolveGlobal[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _resolveGlobal[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"index.js","names":["_load","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_resolve","_resolveGlobal"],"sources":["../src/index.ts"],"sourcesContent":["export * from './load';\nexport * from './resolve';\nexport * from './resolveGlobal';\n"],"mappings":";;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,cAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,cAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,cAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,cAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|