@parcel/utils 2.0.0-nightly.1381 → 2.0.0-nightly.1386
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/lib/index.js +12 -14
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -34624,17 +34624,20 @@ $f2eb8388071f2c88$var$validateSchema.diagnostic = function(schema, data, origin,
|
|
|
34624
34624
|
map = (_data_source = data.source) !== null && _data_source !== void 0 ? _data_source : JSON.stringify((0, (/*@__PURE__*/$parcel$interopDefault($3fb15c2a4d9dd820$exports)))(data.data), 0, " ");
|
|
34625
34625
|
code = map;
|
|
34626
34626
|
}
|
|
34627
|
-
var _data_filePath
|
|
34627
|
+
var _data_filePath;
|
|
34628
34628
|
let codeFrames = [
|
|
34629
34629
|
{
|
|
34630
34630
|
filePath: (_data_filePath = data.filePath) !== null && _data_filePath !== void 0 ? _data_filePath : undefined,
|
|
34631
34631
|
language: "json",
|
|
34632
34632
|
code: code,
|
|
34633
|
-
codeHighlights: (0, $eJUMF$parceldiagnostic.generateJSONCodeHighlights)(map, keys.map(({ key: key, type: type, message: message })=>
|
|
34633
|
+
codeHighlights: (0, $eJUMF$parceldiagnostic.generateJSONCodeHighlights)(map, keys.map(({ key: key, type: type, message: message })=>{
|
|
34634
|
+
var _data_prependKey;
|
|
34635
|
+
return {
|
|
34634
34636
|
key: ((_data_prependKey = data.prependKey) !== null && _data_prependKey !== void 0 ? _data_prependKey : "") + key,
|
|
34635
34637
|
type: type,
|
|
34636
34638
|
message: message != null ? (0, $eJUMF$parceldiagnostic.escapeMarkdown)(message) : message
|
|
34637
|
-
}
|
|
34639
|
+
};
|
|
34640
|
+
}))
|
|
34638
34641
|
}
|
|
34639
34642
|
];
|
|
34640
34643
|
throw new (0, ($parcel$interopDefault($eJUMF$parceldiagnostic)))({
|
|
@@ -36709,9 +36712,8 @@ function $1b5cf2552daa3eaf$export$d175e66e9fcd7b75(fs, filepath, filenames, proj
|
|
|
36709
36712
|
return fs.findAncestorFile(filenames, (0, ($parcel$interopDefault($eJUMF$path))).dirname(filepath), projectRoot);
|
|
36710
36713
|
}
|
|
36711
36714
|
async function $1b5cf2552daa3eaf$export$c1a4367d4847eb06(fs, filepath, filenames, projectRoot, opts) {
|
|
36712
|
-
var _opts;
|
|
36713
36715
|
var _opts_parse;
|
|
36714
|
-
let parse = (_opts_parse =
|
|
36716
|
+
let parse = (_opts_parse = opts === null || opts === void 0 ? void 0 : opts.parse) !== null && _opts_parse !== void 0 ? _opts_parse : true;
|
|
36715
36717
|
let configFile = await $1b5cf2552daa3eaf$export$7eca4ea16d4c8343(fs, filepath, filenames, projectRoot);
|
|
36716
36718
|
if (configFile) {
|
|
36717
36719
|
let cachedOutput = $1b5cf2552daa3eaf$var$configCache.get(String(parse) + configFile);
|
|
@@ -36744,9 +36746,8 @@ $1b5cf2552daa3eaf$export$c1a4367d4847eb06.clear = ()=>{
|
|
|
36744
36746
|
$1b5cf2552daa3eaf$var$resolveCache.clear();
|
|
36745
36747
|
};
|
|
36746
36748
|
async function $1b5cf2552daa3eaf$export$f5327b421858c8cd(fs, configFile, opts) {
|
|
36747
|
-
var _opts;
|
|
36748
36749
|
var _opts_parse;
|
|
36749
|
-
let parse = (_opts_parse =
|
|
36750
|
+
let parse = (_opts_parse = opts === null || opts === void 0 ? void 0 : opts.parse) !== null && _opts_parse !== void 0 ? _opts_parse : true;
|
|
36750
36751
|
let cachedOutput = $1b5cf2552daa3eaf$var$configCache.get(String(parse) + configFile);
|
|
36751
36752
|
if (cachedOutput) return cachedOutput;
|
|
36752
36753
|
try {
|
|
@@ -36754,10 +36755,9 @@ async function $1b5cf2552daa3eaf$export$f5327b421858c8cd(fs, configFile, opts) {
|
|
|
36754
36755
|
let config;
|
|
36755
36756
|
if (parse === false) config = configContent;
|
|
36756
36757
|
else {
|
|
36757
|
-
var _opts1;
|
|
36758
36758
|
let extname = (0, ($parcel$interopDefault($eJUMF$path))).extname(configFile).slice(1);
|
|
36759
36759
|
var _opts_parser;
|
|
36760
|
-
let parse = (_opts_parser =
|
|
36760
|
+
let parse = (_opts_parser = opts === null || opts === void 0 ? void 0 : opts.parser) !== null && _opts_parser !== void 0 ? _opts_parser : $1b5cf2552daa3eaf$var$getParser(extname);
|
|
36761
36761
|
try {
|
|
36762
36762
|
config = parse(configContent);
|
|
36763
36763
|
} catch (e) {
|
|
@@ -37142,9 +37142,8 @@ async function $da0b7647e94c7f83$export$f074a8f9bef628fd({ bundle: bundle, bundl
|
|
|
37142
37142
|
if (node.type === "dependency") dependencies.push(node.value);
|
|
37143
37143
|
});
|
|
37144
37144
|
for (let dependency of dependencies){
|
|
37145
|
-
var _entryBundle;
|
|
37146
37145
|
let entryBundle = bundleGraph.getReferencedBundle(dependency, bundle);
|
|
37147
|
-
if ((
|
|
37146
|
+
if ((entryBundle === null || entryBundle === void 0 ? void 0 : entryBundle.bundleBehavior) !== "inline") continue;
|
|
37148
37147
|
let packagedBundle = await getInlineBundleContents(entryBundle, bundleGraph);
|
|
37149
37148
|
let packagedContents = (packagedBundle.contents instanceof (0, $eJUMF$stream.Readable) ? await (0, $94281e95849778d7$export$f109d1c79a5ae5a1)(packagedBundle.contents) : packagedBundle.contents).toString();
|
|
37150
37149
|
let inlineType = (0, (/*@__PURE__*/$parcel$interopDefault($3fb15c2a4d9dd820$exports)))(entryBundle.getMainEntry()).meta.inlineType;
|
|
@@ -37501,18 +37500,17 @@ async function $58ae611e06043814$export$c500fecaca54de65(filename, contents, opt
|
|
|
37501
37500
|
}
|
|
37502
37501
|
}
|
|
37503
37502
|
function $58ae611e06043814$export$2fed780245c466c1(loc, originalMap) {
|
|
37504
|
-
var _start, _end;
|
|
37505
37503
|
let { filePath: filePath, start: { line: startLine, column: startCol }, end: { line: endLine, column: endCol } } = loc;
|
|
37506
37504
|
let lineDiff = endLine - startLine;
|
|
37507
37505
|
let colDiff = endCol - startCol;
|
|
37508
37506
|
let start = originalMap.findClosestMapping(startLine, startCol - 1);
|
|
37509
37507
|
let end = originalMap.findClosestMapping(endLine, endCol - 1);
|
|
37510
|
-
if (
|
|
37508
|
+
if (start === null || start === void 0 ? void 0 : start.original) {
|
|
37511
37509
|
if (start.source) filePath = start.source;
|
|
37512
37510
|
({ line: startLine, column: startCol } = start.original);
|
|
37513
37511
|
startCol++; // source map columns are 0-based
|
|
37514
37512
|
}
|
|
37515
|
-
if (
|
|
37513
|
+
if (end === null || end === void 0 ? void 0 : end.original) {
|
|
37516
37514
|
({ line: endLine, column: endCol } = end.original);
|
|
37517
37515
|
endCol++; // source map columns are 0-based
|
|
37518
37516
|
if (endLine < startLine) {
|