@drakulavich/oura-cli 0.3.3 → 0.3.4
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/CHANGELOG.md +12 -0
- package/dist/index.js +23 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,16 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.3.4] - 2026-05-13
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- `oura-cli report` daily table: Sleep / Readiness / Activity / Steps
|
|
13
|
+
columns now align under their headers. Previously, `chalk` ANSI codes
|
|
14
|
+
inflated the byte count of coloured score strings, so `.padStart(...)`
|
|
15
|
+
produced near-zero padding and adjacent scores ran together (e.g.
|
|
16
|
+
`87 85 90` instead of separate right-aligned columns). The same bug
|
|
17
|
+
affected the monthly bucket view.
|
|
18
|
+
|
|
9
19
|
## [0.3.3] - 2026-05-13
|
|
10
20
|
|
|
11
21
|
### Changed
|
|
@@ -158,6 +168,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
158
168
|
- Local SQLite cache at `~/.oura-cli/oura.db`.
|
|
159
169
|
- Auth via `oura-cli login`, `OURA_TOKEN`, `OURA_TOKEN_PATH`, or `~/.oura-token`.
|
|
160
170
|
|
|
171
|
+
[0.3.4]: https://github.com/drakulavich/oura-cli/releases/tag/v0.3.4
|
|
172
|
+
[0.3.3]: https://github.com/drakulavich/oura-cli/releases/tag/v0.3.3
|
|
161
173
|
[0.3.2]: https://github.com/drakulavich/oura-cli/releases/tag/v0.3.2
|
|
162
174
|
[0.3.1]: https://github.com/drakulavich/oura-cli/releases/tag/v0.3.1
|
|
163
175
|
[0.3.0]: https://github.com/drakulavich/oura-cli/releases/tag/v0.3.0
|
package/dist/index.js
CHANGED
|
@@ -3602,6 +3602,23 @@ function getReport(db, days) {
|
|
|
3602
3602
|
}
|
|
3603
3603
|
|
|
3604
3604
|
// src/format-report.ts
|
|
3605
|
+
function colorizeScore(n) {
|
|
3606
|
+
if (n >= 85)
|
|
3607
|
+
return source_default.green;
|
|
3608
|
+
if (n >= 70)
|
|
3609
|
+
return source_default.yellow;
|
|
3610
|
+
return source_default.red;
|
|
3611
|
+
}
|
|
3612
|
+
function scoreCell(n, width) {
|
|
3613
|
+
if (n === null)
|
|
3614
|
+
return source_default.gray("\u2014".padStart(width));
|
|
3615
|
+
return colorizeScore(n)(String(n).padStart(width));
|
|
3616
|
+
}
|
|
3617
|
+
function stepsCell(n, width) {
|
|
3618
|
+
if (n === null)
|
|
3619
|
+
return source_default.gray("\u2014".padStart(width));
|
|
3620
|
+
return n.toLocaleString().padStart(width);
|
|
3621
|
+
}
|
|
3605
3622
|
function fmtSeconds(s) {
|
|
3606
3623
|
if (s === null)
|
|
3607
3624
|
return "\u2014";
|
|
@@ -3659,11 +3676,7 @@ function formatReport(data, format, period) {
|
|
|
3659
3676
|
lines.push(` ${"Day".padEnd(10)} ${"Sleep".padStart(6)} ${"Ready".padStart(6)} ${"Active".padStart(7)} ${"Steps".padStart(8)}`);
|
|
3660
3677
|
lines.push(source_default.gray(" " + "\u2500".repeat(52)));
|
|
3661
3678
|
for (const d of data.days) {
|
|
3662
|
-
|
|
3663
|
-
const ready = d.readiness !== null ? d.readiness >= 85 ? source_default.green(String(d.readiness)) : d.readiness >= 70 ? source_default.yellow(String(d.readiness)) : source_default.red(String(d.readiness)) : source_default.gray("\u2014");
|
|
3664
|
-
const active = d.activity !== null ? d.activity >= 85 ? source_default.green(String(d.activity)) : d.activity >= 70 ? source_default.yellow(String(d.activity)) : source_default.red(String(d.activity)) : source_default.gray("\u2014");
|
|
3665
|
-
const steps = d.steps !== null ? d.steps.toLocaleString() : source_default.gray("\u2014");
|
|
3666
|
-
lines.push(` ${d.dayLabel.padEnd(10)} ${sleep.padStart(6)} ${ready.padStart(6)} ${active.padStart(7)} ${steps.padStart(8)}`);
|
|
3679
|
+
lines.push(` ${d.dayLabel.padEnd(10)} ${scoreCell(d.sleep, 6)} ${scoreCell(d.readiness, 6)} ${scoreCell(d.activity, 7)} ${stepsCell(d.steps, 8)}`);
|
|
3667
3680
|
}
|
|
3668
3681
|
lines.push("");
|
|
3669
3682
|
} else {
|
|
@@ -3673,11 +3686,10 @@ function formatReport(data, format, period) {
|
|
|
3673
3686
|
lines.push(` ${"Week of".padEnd(12)} ${"Sleep".padStart(6)} ${"Ready".padStart(6)} ${"Active".padStart(7)} ${"Steps".padStart(10)}`);
|
|
3674
3687
|
lines.push(source_default.gray(" " + "\u2500".repeat(60)));
|
|
3675
3688
|
for (const b of buckets) {
|
|
3676
|
-
const
|
|
3677
|
-
const
|
|
3678
|
-
const
|
|
3679
|
-
|
|
3680
|
-
lines.push(` ${b.weekOf.padEnd(12)} ${sleep.padStart(6)} ${ready.padStart(6)} ${active.padStart(7)} ${steps.padStart(10)}`);
|
|
3689
|
+
const avgSleepInt = b.avgSleep !== null ? Math.round(b.avgSleep) : null;
|
|
3690
|
+
const avgReadyInt = b.avgReadiness !== null ? Math.round(b.avgReadiness) : null;
|
|
3691
|
+
const avgActiveInt = b.avgActivity !== null ? Math.round(b.avgActivity) : null;
|
|
3692
|
+
lines.push(` ${b.weekOf.padEnd(12)} ${scoreCell(avgSleepInt, 6)} ${scoreCell(avgReadyInt, 6)} ${scoreCell(avgActiveInt, 7)} ${stepsCell(b.totalSteps, 10)}`);
|
|
3681
3693
|
}
|
|
3682
3694
|
lines.push("");
|
|
3683
3695
|
}
|
|
@@ -3917,7 +3929,7 @@ function describeCommand(version) {
|
|
|
3917
3929
|
}
|
|
3918
3930
|
|
|
3919
3931
|
// src/index.ts
|
|
3920
|
-
var VERSION = "0.3.
|
|
3932
|
+
var VERSION = "0.3.4";
|
|
3921
3933
|
if (process.argv.includes("--no-color") || process.env.NO_COLOR) {
|
|
3922
3934
|
source_default.level = 0;
|
|
3923
3935
|
}
|
package/package.json
CHANGED