fifa-wc26 0.2.2 → 0.3.0
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/cli.js +49 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -18,6 +18,49 @@ var init_esm_shims = __esm({
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
+
// src/render/time.ts
|
|
22
|
+
function detectTimeZone() {
|
|
23
|
+
const override = process.env.WC26_TZ?.trim();
|
|
24
|
+
if (override) {
|
|
25
|
+
try {
|
|
26
|
+
new Intl.DateTimeFormat("en-US", { timeZone: override });
|
|
27
|
+
return override;
|
|
28
|
+
} catch {
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
33
|
+
} catch {
|
|
34
|
+
return "UTC";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function formatKickoff(iso, tz = detectTimeZone()) {
|
|
38
|
+
const d = new Date(iso);
|
|
39
|
+
if (Number.isNaN(d.getTime())) return iso;
|
|
40
|
+
try {
|
|
41
|
+
return new Intl.DateTimeFormat("sv-SE", {
|
|
42
|
+
timeZone: tz,
|
|
43
|
+
year: "numeric",
|
|
44
|
+
month: "2-digit",
|
|
45
|
+
day: "2-digit",
|
|
46
|
+
hour: "2-digit",
|
|
47
|
+
minute: "2-digit",
|
|
48
|
+
hour12: false
|
|
49
|
+
}).format(d);
|
|
50
|
+
} catch {
|
|
51
|
+
return d.toISOString().replace("T", " ").replace(/:\d{2}\.\d{3}Z$/, "");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function tzLabel(tz = detectTimeZone()) {
|
|
55
|
+
return tz || "UTC";
|
|
56
|
+
}
|
|
57
|
+
var init_time = __esm({
|
|
58
|
+
"src/render/time.ts"() {
|
|
59
|
+
"use strict";
|
|
60
|
+
init_esm_shims();
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
21
64
|
// src/render/live-dashboard.tsx
|
|
22
65
|
var live_dashboard_exports = {};
|
|
23
66
|
__export(live_dashboard_exports, {
|
|
@@ -62,7 +105,7 @@ function Dashboard({ live, upcoming, stale, reason, favoriteOnly }) {
|
|
|
62
105
|
] }, m.id)),
|
|
63
106
|
/* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(Text, { bold: true, children: "Upcoming" }) }),
|
|
64
107
|
upcoming.length === 0 ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: "none" }) : upcoming.map((f) => /* @__PURE__ */ jsxs(Box, { children: [
|
|
65
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: f.utcKickoff
|
|
108
|
+
/* @__PURE__ */ jsx(Text, { dimColor: true, children: formatKickoff(f.utcKickoff) }),
|
|
66
109
|
/* @__PURE__ */ jsxs(Text, { children: [
|
|
67
110
|
" ",
|
|
68
111
|
f.home.code,
|
|
@@ -82,6 +125,7 @@ var init_live_dashboard = __esm({
|
|
|
82
125
|
"src/render/live-dashboard.tsx"() {
|
|
83
126
|
"use strict";
|
|
84
127
|
init_esm_shims();
|
|
128
|
+
init_time();
|
|
85
129
|
}
|
|
86
130
|
});
|
|
87
131
|
|
|
@@ -1083,6 +1127,7 @@ function renderTeamPlain(t) {
|
|
|
1083
1127
|
|
|
1084
1128
|
// src/render/pretty.ts
|
|
1085
1129
|
init_esm_shims();
|
|
1130
|
+
init_time();
|
|
1086
1131
|
import Table from "cli-table3";
|
|
1087
1132
|
import chalk from "chalk";
|
|
1088
1133
|
var stageLabel = (s) => ({
|
|
@@ -1102,13 +1147,14 @@ var colorStatus = (s) => {
|
|
|
1102
1147
|
var scoreStr2 = (f) => f.score ? `${f.score.home}-${f.score.away}` : "\u2013";
|
|
1103
1148
|
function renderFixturesPretty(fixtures, emptyMessage = "no matches") {
|
|
1104
1149
|
if (fixtures.length === 0) return chalk.dim(emptyMessage);
|
|
1150
|
+
const tz = detectTimeZone();
|
|
1105
1151
|
const t = new Table({
|
|
1106
|
-
head: [
|
|
1152
|
+
head: [`Kickoff (${tzLabel(tz)})`, "Stage", "Home", "Away", "Venue", "Score", "Status"],
|
|
1107
1153
|
style: { head: ["bold"] }
|
|
1108
1154
|
});
|
|
1109
1155
|
for (const f of fixtures) {
|
|
1110
1156
|
t.push([
|
|
1111
|
-
f.utcKickoff
|
|
1157
|
+
formatKickoff(f.utcKickoff, tz),
|
|
1112
1158
|
`${stageLabel(f.stage)}${f.group ? " " + f.group : ""}`,
|
|
1113
1159
|
`${f.home.code} ${chalk.dim(f.home.name)}`,
|
|
1114
1160
|
`${f.away.code} ${chalk.dim(f.away.name)}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fifa-wc26",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "FIFA World Cup 2026 CLI: fixtures, live scores, group standings, ASCII bracket, team lookup. Keyless providers, smart cache, terminal-friendly output.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|