@wral/hsot-data 0.3.0 → 0.5.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/README.md CHANGED
@@ -9,10 +9,10 @@ exactly one of these elements.
9
9
 
10
10
  | Component | Page | Key attributes |
11
11
  |---|---|---|
12
- | `<hsot-scores>` | Scores/Schedules (the scoreboard; future dates are schedules) | `sport`, `date` (YYYY-MM-DD, deep-linkable via `?date=`; defaults to the closest matchday: today when games are on, otherwise the previous one), `season`, `refresh-interval` |
13
- | `<hsot-standings>` | Standings, every conference for a sport | `sport`, `season` |
12
+ | `<hsot-scores>` | Scores/Schedules (the scoreboard; future dates are schedules): an All Games list or a Conferences view, filterable by area code | `sport`, `date` (YYYY-MM-DD, deep-linkable via `?date=`; defaults to the closest matchday: today when games are on, otherwise the previous one), `view` (`all` or `conferences`, `?view=`), `area-code` (`?area=`), `season`, `refresh-interval` |
13
+ | `<hsot-standings>` | Standings, every conference for a sport | `sport`, `gender` (one side of a gendered sport), `season` |
14
14
  | `<hsot-rankings>` | The weekly Top 25 with movement + rank history | `sport`, `gender` (poll family), `season`, deep link `?poll=YYYY-MM-DD` |
15
- | `<hsot-school>` | School hub: hero, team tabs, schedule, roster (headed by the season's roster photo when one is set; positions render as a list, "WR/CB"; a College column appears when a player carries a commitment), honors | `school-id`, `sport` (initial tab, deep link `?sport=`), `season` |
15
+ | `<hsot-school>` | School hub: hero, team tabs, schedule, roster (headed by the season's roster photo when one is set; positions render as a list, "WR/CB"; a College column appears when a player carries a commitment), honors | `school-id`, `sport` + `gender` (initial tab, deep links `?sport=` / `?gender=`), `season` |
16
16
  | `<hsot-boxscore>` | Game detail: line score (stored `periodScores`, or derived from the scoring plays when nothing wrote one — `src/lib/line-score.mjs`, shown only when it reconciles with the score), the desk's scoring-play log when a game carries one (period, clock, play, running score), coverage, season context; game notes keep their line breaks | `game-id`, `refresh-interval` |
17
17
  | `<hsot-brackets>` | Playoff brackets: a sport's tournaments for the season, rounds as columns laid out from the winner edges (seedings place round one; `GET /tournaments/{id}/edges` is the tree), group tabs for split brackets (East / West / Championship), scores and the champion once played | `sport`, `season`, `tournament-id` (pin one; otherwise `?tournament=` or the bracket in play), `refresh-interval` |
18
18
  | `<hsot-school-search>` | "Find Your School" typeahead for the right rail (standalone: fetches `GET /schools?q=` itself, no injected client) | `api`, `school-href`, `limit`, `placeholder` |
@@ -20,9 +20,25 @@ exactly one of these elements.
20
20
  The live status pill on every component reads the game clock beside the
21
21
  period when the desk has typed one ("Live · 3Q 6:54", api-hsot v1.13.0-draft).
22
22
 
23
- `hsot-scores` lists live games first, then matchups featuring ranked teams
24
- (#1 at the top, using the poll in effect on the game date), then the rest in
25
- schedule order.
23
+ `hsot-scores` has two views of a date's games (DEV-1303,
24
+ `src/lib/scoreboard.mjs`):
25
+
26
+ - **All Games** (the default): one list, matchups featuring ranked teams
27
+ first (#1 at the top, using the poll in effect on the game date), then
28
+ every other game A → Z by the road team's school. The order ignores game
29
+ state, so the alphabetical list doesn't reshuffle as games go live and
30
+ final through the night.
31
+ - **Conferences view**: grouped by conference (Nonconference, Playoffs and
32
+ Scrimmages as their own groups), live games first, then ranked matchups,
33
+ then the rest in schedule order.
34
+
35
+ Area-code chips (the `areaCode` on each school profile) narrow either view
36
+ to games where **either** school is in that area, so a 919-at-704 game shows
37
+ under both. The chips list the codes the sport's schools carry; a school
38
+ with no area code set matches no area. Picking a view or an area writes
39
+ `?view=` / `?area=` back to the URL (`history.replaceState`), so a filtered
40
+ scoreboard can be shared; the date is not written back, so a bookmarked page
41
+ still opens on the closest matchday.
26
42
 
27
43
  Shared attributes on every data component (`hsot-school-search` takes only
28
44
  `api` and `school-href`):
@@ -119,6 +135,33 @@ That logic is `src/lib/records.mjs` and `src/lib/polls.mjs`, unit-tested with
119
135
  `node --test`. If api-hsot ever grows derived read endpoints, those two files
120
136
  are what they replace.
121
137
 
138
+ ## Sport is not gender
139
+
140
+ Most sports HSOT covers are **gendered**: soccer, basketball, lacrosse, cross
141
+ country, swimming, track and the rest field a boys and a girls team per
142
+ school. Both teams carry the same `sport` — the side is a separate `gender`
143
+ field on Team — and a Game carries no gender at all (it inherits one from the
144
+ teams playing it). So **scoping a view by sport alone merges the two halves of
145
+ the sport**, which is exactly what shipped: the standings table listed every
146
+ school twice, once for each side, sorted into one order.
147
+
148
+ Any view that stands for "the teams of a sport" therefore needs a gender too:
149
+
150
+ - `src/lib/teams.mjs` holds the rule — `teamsOfGender()` for the filter,
151
+ `splitsByGender()` for "does this sport have two sides". The family rule
152
+ matches the gendered polls: a side includes coed teams, and a team with no
153
+ gender belongs to no side.
154
+ - `<hsot-standings>` takes `gender`; the section sub-nav links
155
+ `/{sport}/{gender}/standings/` whenever the sport fields both, and an
156
+ un-pinned mount offers a Boys/Girls switch instead of merging.
157
+ - `<hsot-school>` selects its tab by **team id**, not sport: two of a school's
158
+ tabs answer to "soccer", and its conference-place tile counts only the
159
+ team's own side.
160
+
161
+ Records themselves are safe either way — `computeRecords()` keys off team ids,
162
+ and a team only appears in its own side's games — so the merge shows up in the
163
+ team **lists** a view builds, not in the numbers on a row.
164
+
122
165
  ## Development
123
166
 
124
167
  Requires Node 18+.
package/dist/define.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, d as c, H as n, c as a, b as i, f as r, e as h } from "./hsot-brackets-Cc0zj07F.js";
1
+ import { a as e, d as c, H as n, c as a, b as i, f as r, e as h } from "./hsot-brackets-D3mrvZfC.js";
2
2
  const l = {
3
3
  "hsot-scores": h,
4
4
  "hsot-standings": r,