create-yeow 0.2.35 → 0.2.37
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/package.json
CHANGED
|
Binary file
|
|
@@ -199,6 +199,7 @@ async function getSourceMapConsumer() {
|
|
|
199
199
|
async function printFormattedError(err) {
|
|
200
200
|
const c = { r: '\x1b[0m', R: '\x1b[31m', Y: '\x1b[33m', C: '\x1b[36m', B: '\x1b[1m', D: '\x1b[2m' };
|
|
201
201
|
let out = `\n${c.R}${c.B} JS Error [${err.plugin}]${c.r}\n`;
|
|
202
|
+
if (err.context) out += ` ${c.D}context: ${err.context}${c.r}\n`;
|
|
202
203
|
out += ` ${c.Y}${err.message}${c.r}\n`;
|
|
203
204
|
|
|
204
205
|
const consumer = (err.fileName === 'main.js' || err.stack) ? await getSourceMapConsumer() : null;
|
|
@@ -217,8 +218,8 @@ async function printFormattedError(err) {
|
|
|
217
218
|
const prefix = i === orig.line - 1 ? c.R + ' →' : ' ';
|
|
218
219
|
out += ` ${prefix} ${c.D}${String(i + 1).padStart(4)}|${c.r} ${lines[i]}\n`;
|
|
219
220
|
if (i === orig.line - 1 && orig.column > 0) {
|
|
220
|
-
const indent = String(i + 1).padStart(4) + '| ';
|
|
221
221
|
const col = Math.max(0, orig.column);
|
|
222
|
+
const indent = ' '.repeat(String(i + 1).padStart(4).length) + '| ';
|
|
222
223
|
const caret = ' '.repeat(col) + c.R + '^' + c.r;
|
|
223
224
|
out += ` ${c.R} →${c.r} ${indent}${caret}\n`;
|
|
224
225
|
}
|