@parcel/utils 2.0.0-nightly.1085 → 2.0.0-nightly.1089
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 +7 -1
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
- package/src/prettyDiagnostic.js +17 -4
package/lib/index.js
CHANGED
|
@@ -32329,6 +32329,7 @@ async function $f02d6a9d30f55938$export$2e2bcd8739ae039(diagnostic, options, ter
|
|
|
32329
32329
|
message: ($parcel$interopDefault($8C1kk$parcelmarkdownansi))(`**${origin !== null && origin !== void 0 ? origin : 'unknown'}**: `) + (skipFormatting ? message : ($parcel$interopDefault($8C1kk$parcelmarkdownansi))(message)),
|
|
32330
32330
|
stack: '',
|
|
32331
32331
|
codeframe: '',
|
|
32332
|
+
frames: [],
|
|
32332
32333
|
hints: [],
|
|
32333
32334
|
documentation: ''
|
|
32334
32335
|
};
|
|
@@ -32345,9 +32346,14 @@ async function $f02d6a9d30f55938$export$2e2bcd8739ae039(diagnostic, options, ter
|
|
|
32345
32346
|
language: codeFrame.language || (filePath != null ? ($parcel$interopDefault($8C1kk$path)).extname(filePath).substr(1) : undefined),
|
|
32346
32347
|
terminalWidth: terminalWidth
|
|
32347
32348
|
});
|
|
32348
|
-
|
|
32349
|
+
let location = typeof filePath !== 'string' ? '' : `${filePath}:${highlights[0].start.line}:${highlights[0].start.column}`;
|
|
32350
|
+
result.codeframe += location ? ($parcel$interopDefault($8C1kk$chalk)).gray.underline(location) + '\n' : '';
|
|
32349
32351
|
result.codeframe += formattedCodeFrame;
|
|
32350
32352
|
if (codeFrame !== codeFrames[codeFrames.length - 1]) result.codeframe += '\n\n';
|
|
32353
|
+
result.frames.push({
|
|
32354
|
+
location: location,
|
|
32355
|
+
code: formattedCodeFrame
|
|
32356
|
+
});
|
|
32351
32357
|
}
|
|
32352
32358
|
if (stack != null) result.stack = stack;
|
|
32353
32359
|
if (Array.isArray(hints) && hints.length) result.hints = hints.map((h)=>{
|