prior-cli 1.5.0 → 1.5.2
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/bin/prior.js +17 -31
- package/package.json +1 -1
package/bin/prior.js
CHANGED
|
@@ -414,42 +414,28 @@ function dayLabel(dateStr) {
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
function renderWeatherCard(w) {
|
|
417
|
-
|
|
418
|
-
const
|
|
419
|
-
|
|
420
|
-
return str + ' '.repeat(Math.max(0, len - plain.length));
|
|
421
|
-
};
|
|
422
|
-
const line = (content = '') => {
|
|
423
|
-
process.stdout.write(c.muted(' │ ') + content + c.muted(' │') + '\n');
|
|
424
|
-
};
|
|
425
|
-
const rule = ' ├' + '─'.repeat(W) + '┤';
|
|
426
|
-
const top = ' ╭' + '─'.repeat(W) + '╮';
|
|
427
|
-
const bot = ' ╰' + '─'.repeat(W) + '╯';
|
|
428
|
-
|
|
429
|
-
const location = `📍 ${w.city}${w.country ? ', ' + w.country : ''}`;
|
|
430
|
-
const icon = weatherIcon(w.code);
|
|
431
|
-
const condLine = `${icon} ${w.desc}`;
|
|
432
|
-
const tempLine = `🌡 ${w.tempC}°C ${c.dim(`feels like ${w.feelsC}°C`)}`;
|
|
433
|
-
const infoLine = `💧 ${w.humidity}% 💨 ${w.windKmph} km/h`;
|
|
417
|
+
// Use left-border-only style — avoids emoji column-width alignment issues
|
|
418
|
+
const L = ' │ ';
|
|
419
|
+
const hr = ' ├─────────────────────────────────────\n';
|
|
434
420
|
|
|
435
|
-
process.stdout.write(c.muted(
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
421
|
+
process.stdout.write(c.muted(' ┌─────────────────────────────────────\n'));
|
|
422
|
+
process.stdout.write(c.muted(L) + c.bold(`📍 ${w.city}${w.country ? ', ' + w.country : ''}`) + '\n');
|
|
423
|
+
process.stdout.write(c.muted(L) + '\n');
|
|
424
|
+
process.stdout.write(c.muted(L) + `${weatherIcon(w.code)} ${w.desc}` + '\n');
|
|
425
|
+
process.stdout.write(c.muted(L) + `🌡 ${c.bold(w.tempC + '°C')} ${c.dim('feels like ' + w.feelsC + '°C')}` + '\n');
|
|
426
|
+
process.stdout.write(c.muted(L) + c.dim(`💧 ${w.humidity}% 💨 ${w.windKmph} km/h`) + '\n');
|
|
441
427
|
|
|
442
428
|
if (w.forecast && w.forecast.length) {
|
|
443
|
-
process.stdout.write(c.muted(
|
|
444
|
-
const
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
429
|
+
process.stdout.write(c.muted(hr));
|
|
430
|
+
for (const f of w.forecast) {
|
|
431
|
+
const day = dayLabel(f.date).padEnd(4);
|
|
432
|
+
const icon = weatherIcon(f.code);
|
|
433
|
+
const tmp = `${f.maxC}° / ${f.minC}°`;
|
|
434
|
+
process.stdout.write(c.muted(L) + c.dim(day) + ` ${icon} ` + c.dim(tmp) + '\n');
|
|
435
|
+
}
|
|
450
436
|
}
|
|
451
437
|
|
|
452
|
-
process.stdout.write(c.muted(
|
|
438
|
+
process.stdout.write(c.muted(' └─────────────────────────────────────\n'));
|
|
453
439
|
}
|
|
454
440
|
|
|
455
441
|
function renderToolDone(name, summary, preview, weatherData) {
|