@claudinho/cli 0.8.3 → 0.8.5
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/dist/index.js +23 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -450,6 +450,7 @@ function formatKickoff(iso, opts = {}) {
|
|
|
450
450
|
const locale = safeLocale(opts.locale);
|
|
451
451
|
return new Intl.DateTimeFormat(locale, {
|
|
452
452
|
weekday: "short",
|
|
453
|
+
...opts.date ? { month: "short", day: "numeric" } : {},
|
|
453
454
|
hour: "2-digit",
|
|
454
455
|
minute: "2-digit",
|
|
455
456
|
hour12: false,
|
|
@@ -3048,6 +3049,18 @@ function hasGroupStarted(group, tables) {
|
|
|
3048
3049
|
if (!table?.rows.length) return false;
|
|
3049
3050
|
return table.rows.some((r) => r.played > 0);
|
|
3050
3051
|
}
|
|
3052
|
+
function matchesPerTeamInGroup(teamCount) {
|
|
3053
|
+
return Math.max(0, teamCount - 1);
|
|
3054
|
+
}
|
|
3055
|
+
function isGroupStandingsComplete(table) {
|
|
3056
|
+
const n = table?.rows.length ?? 0;
|
|
3057
|
+
if (n < 2) return false;
|
|
3058
|
+
const required = matchesPerTeamInGroup(n);
|
|
3059
|
+
return table.rows.every((r) => r.played >= required);
|
|
3060
|
+
}
|
|
3061
|
+
function isGroupComplete(group, tables) {
|
|
3062
|
+
return isGroupStandingsComplete(tables.find((t2) => t2.group === group));
|
|
3063
|
+
}
|
|
3051
3064
|
function resolveWinner(match) {
|
|
3052
3065
|
if (!isFinished(match.status)) return void 0;
|
|
3053
3066
|
if (match.winnerCode) {
|
|
@@ -3096,7 +3109,10 @@ function resolveSlot(ref, ctx) {
|
|
|
3096
3109
|
case "group": {
|
|
3097
3110
|
if (!ctx.standingsDegraded && hasGroupStarted(ref.group, ctx.tables)) {
|
|
3098
3111
|
const team = teamFromStandings(ref.group, ref.position, ctx.tables);
|
|
3099
|
-
if (team)
|
|
3112
|
+
if (team) {
|
|
3113
|
+
const status = isGroupComplete(ref.group, ctx.tables) ? "confirmed" : "projected";
|
|
3114
|
+
return participant(team, status);
|
|
3115
|
+
}
|
|
3100
3116
|
}
|
|
3101
3117
|
const label = ref.position === 1 ? t(ctx.lang, "bracket.slot.groupWinner", { group: ref.group }) : t(ctx.lang, "bracket.slot.groupSecond", { group: ref.group });
|
|
3102
3118
|
return tbd(label);
|
|
@@ -4399,6 +4415,9 @@ function statusTail2(m) {
|
|
|
4399
4415
|
if (isLive(m.status)) return " LIVE";
|
|
4400
4416
|
return "";
|
|
4401
4417
|
}
|
|
4418
|
+
function formatBracketKickoff(iso, opts) {
|
|
4419
|
+
return formatKickoff(iso, { tz: opts.tz, locale: opts.locale, date: true });
|
|
4420
|
+
}
|
|
4402
4421
|
function formatBracketMatchLine(mv, opts = {}) {
|
|
4403
4422
|
const flags = opts.flags !== false;
|
|
4404
4423
|
const home = formatParticipant(mv.home, "home", flags, opts.locale);
|
|
@@ -4407,7 +4426,7 @@ function formatBracketMatchLine(mv, opts = {}) {
|
|
|
4407
4426
|
if (isFinished(m.status) || isLive(m.status)) {
|
|
4408
4427
|
return ` ${home} ${scoreline(m)} ${away}${statusTail2(m)}`;
|
|
4409
4428
|
}
|
|
4410
|
-
const kickoff = mv.kickoff ?
|
|
4429
|
+
const kickoff = mv.kickoff ? formatBracketKickoff(mv.kickoff, opts) : "";
|
|
4411
4430
|
return ` ${home} vs ${away}${kickoff ? ` \xB7 ${kickoff}` : ""}`;
|
|
4412
4431
|
}
|
|
4413
4432
|
function formatBracketList(view, opts = {}) {
|
|
@@ -4504,7 +4523,7 @@ function formatBracketCompactLine(mv, opts = {}) {
|
|
|
4504
4523
|
const away = formatParticipant(mv.away, "away", flags, opts.locale);
|
|
4505
4524
|
const m = mv.match;
|
|
4506
4525
|
const mid2 = isFinished(m.status) || isLive(m.status) ? scoreline(m) : "vs";
|
|
4507
|
-
const tail = m.status === "SCHEDULED" && mv.kickoff ? ` \xB7 ${
|
|
4526
|
+
const tail = m.status === "SCHEDULED" && mv.kickoff ? ` \xB7 ${formatBracketKickoff(mv.kickoff, opts)}` : statusTail2(m);
|
|
4508
4527
|
return `${stageLabelI18n(opts.locale, mv.stage)} \xB7 ${home} ${mid2} ${away}${tail}`;
|
|
4509
4528
|
}
|
|
4510
4529
|
|
|
@@ -6173,7 +6192,7 @@ function handlePipeError(stream) {
|
|
|
6173
6192
|
}
|
|
6174
6193
|
handlePipeError(process.stdout);
|
|
6175
6194
|
handlePipeError(process.stderr);
|
|
6176
|
-
var VERSION = "0.8.
|
|
6195
|
+
var VERSION = "0.8.5";
|
|
6177
6196
|
var DISCLAIMER = "Claudinho is an independent fan project. Not affiliated with or endorsed by FIFA or Anthropic.";
|
|
6178
6197
|
function ctxFrom(cmd) {
|
|
6179
6198
|
let root = cmd;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudinho/cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "Live scores, fixtures, group tables, and read-only prediction-market signals for the 2026 men's football tournament — in your terminal, Claude Code, and Cursor CLI statusline. No API keys. Not affiliated with FIFA or Anthropic.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"tsup": "^8.0.0",
|
|
62
62
|
"typescript": "^5.7.0",
|
|
63
63
|
"vitest": "^4.1.9",
|
|
64
|
-
"@claudinho/core": "0.8.
|
|
64
|
+
"@claudinho/core": "0.8.5"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "tsup",
|