@finbheara/domain 0.52.0 → 0.54.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
@@ -7,6 +7,8 @@ person names.
7
7
 
8
8
  - **Places**: a print in, the set of place-tree nodes it may mean out. A country, a state or
9
9
  province, a county, a city, or a CLRG region, with a relation between any two readings.
10
+ - **CLRG events**: the Worlds, the nationals and the regional Oireachtais by event code, with
11
+ tier, canonical name, jurisdiction and North American eligibility.
10
12
  - **CLRG regions**: the CLRG's dance regions and their Oireachtas codes, and the region a
11
13
  location phrase falls in.
12
14
  - **School names**: a printed school name in, a `SchoolName` out, with a display form, a
@@ -40,13 +42,14 @@ ESM, Node ≥ 22 or Bun ≥ 1.4.2. MIT. Not affiliated with or endorsed by any d
40
42
  | `@finbheara/domain/place` | `place()`, `createPlaceReader`, `placeRelation`, the `Place` types |
41
43
  | `@finbheara/domain/geocode` | `geocode()`: a location field read by the place store, then by every GeoNames town of AU, CA, GB, IE, NZ and US; `townCell` |
42
44
  | `@finbheara/domain/clrg-regions` | `REGIONS`, `regionOf`, `resolvePhrase` |
45
+ | `@finbheara/domain/event` | `EVENT_REGISTER`, `EVENT_REGISTER_BY_CODE`, `EVENT_TIER`, `eventTier`, `isMajorEvent`, `eventCodeOfSlug`, the `EventRegisterRow` type: the CLRG championships of tier 1 to 3 (below) |
43
46
  | `@finbheara/domain/school` | `createSchoolNameReader`, `DEFAULT_SCHOOL_NAME_READER`, `compareSchoolNames`, `foldSchoolName`, `schoolEncoder`, `schoolColumns` |
44
47
  | `@finbheara/domain/tune` | `tune()`, `tuneRelation`, `tempoLegal`, `settingAt`, `TUNE_NODES`: the CLRG set dance list, each tune with its time, speeds and bars |
45
48
  | `@finbheara/domain/ceili` | `ceili()`, `ceiliRelation`, `CEILI_NODES`: the céilí handbook dances |
46
49
  | `@finbheara/domain/dance` | `dance()`: a print read as a tune and a céilí dance, narrowed by its round |
47
50
  | `@finbheara/domain/age` | `Age.from`, `Age.fromYOB`, `Age.fromTitle`, `ageTitleToken`, `ageRelation`, `canOverlap`, `averageAge`, `isAveraged`, `intersectBirthYears`, `validYOB`, `DEFAULT_ADULT_KEYWORDS`, the age constants |
48
51
  | `@finbheara/domain/noun-index` | `createIndex`, `indexSchema`, `personEncoder`, `roleEncoder`, `roleSchoolGlob`, and the `SqlHandle`/`NounEncoder` types: a database-backed name map (below) |
49
- | `@finbheara/domain/dance-types` | `danceTypes()`, `DANCE_TYPES`, `rhythmOfTime`, and the shared `DanceMatch`/`DanceRelation`/`SetRhythm`/`TimeSignature` types |
52
+ | `@finbheara/domain/dance-types` | `danceTypes()`, `DANCE_TYPES`, `GRADE_DANCES` and `isGradeDance()` (the six solo dances a grade is held in, per dance), `rhythmOfTime`, and the shared `DanceMatch`/`DanceRelation`/`SetRhythm`/`TimeSignature` types |
50
53
  | `@finbheara/domain/promotion` | `samePromotedRow`, `samePromotedSchool`, `samePromotedHeir`, `samePromotedName`, `questionMarksRead`, `foldCharSynonyms`: is a row the same row after a promotion (below) |
51
54
  | `@finbheara/domain/person` | `seatName`, `dancerName`, `teacherName`, `roleName`, `roleSentinelOf`, `rolePrintsNoName`, `dancerPrintsNoName`, the role lists and `SHARED_ROW_SENTINELS`: a person's print read in its role (below) |
52
55
  | `@finbheara/domain/title` | `compTitle`, `titleRelation`, `matchTitle`, `ladderOf`, `populationIn`, `populationRelation`, `roundNumbersIn`, `roundFold`, `codePopulation`, `secondIn`: a competition title read and matched onto syllabus entries, a code's sex suffix, a second chance (below) |
@@ -181,6 +184,21 @@ A region is always the CLRG council that runs a place, and never its province or
181
184
  the two differ. County Louth lies in the province of Leinster and is run by the Ulster council,
182
185
  so it reads `ULSTER`, as Northern Ireland reads `ULSTER` and Wales `ENG_MIDLANDS`.
183
186
 
187
+ ## Look up a CLRG event
188
+
189
+ ```ts
190
+ import { EVENT_REGISTER_BY_CODE, eventCodeOfSlug, eventTier, isMajorEvent } from "@finbheara/domain/event";
191
+
192
+ EVENT_REGISTER_BY_CODE.get("sro")?.canonicalName; // "Southern Region Oireachtas"
193
+ eventTier("naidc"); // 2
194
+ isMajorEvent("bucharest"); // false: a local feis has no row
195
+ eventCodeOfSlug("naidc2024.514tsb"); // "naidc"
196
+ ```
197
+
198
+ The register carries the Worlds (tier 1), the nationals (2) and the regional Oireachtais (3),
199
+ in that order. It is complete for those tiers and silent below: a code it does not carry is a
200
+ local event or no event code, and `eventTier` answers `null` for both rather than a guess.
201
+
184
202
  ## Read a school name
185
203
 
186
204
  ```ts
package/dist/ceili.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  ceiliById2,
5
5
  ceili2,
6
6
  ceiliRelation2
7
- } from "./chunks/place-gd57gavk.js";
8
- import"./chunks/place-ng98cts4.js";
7
+ } from "./chunks/place-3xxgddqw.js";
8
+ import"./chunks/place-3pgn1jgx.js";
9
9
  export {
10
10
  CEILI_NODES2 as CEILI_NODES,
11
11
  allCeilis2 as allCeilis,
@@ -99,6 +99,18 @@ var DANCE_TYPES2 = Object.freeze([
99
99
  "traditional-set",
100
100
  "set-dance"
101
101
  ]);
102
+ var GRADE_DANCES2 = Object.freeze([
103
+ "reel",
104
+ "light-jig",
105
+ "single-jig",
106
+ "slip-jig",
107
+ "treble-jig",
108
+ "hornpipe"
109
+ ]);
110
+ var GRADED = new Set(GRADE_DANCES2);
111
+ function isGradeDance2(d) {
112
+ return d != null && GRADED.has(d);
113
+ }
102
114
  function rhythmOfTime2(time) {
103
115
  return time === "2/4" || time === "4/4" ? "hornpipe" : "jig";
104
116
  }
@@ -138,4 +150,4 @@ function isDanceTypePrint2(print) {
138
150
  return danceTypes2(print).length > 0;
139
151
  }
140
152
 
141
- export { foldDancePrint, splitTempo, matchNodes, candidateRelation, DANCE_TYPES2, rhythmOfTime2, danceTypes2, danceTypePrints2, isDanceTypePrint2 };
153
+ export { foldDancePrint, splitTempo, matchNodes, candidateRelation, DANCE_TYPES2, GRADE_DANCES2, isGradeDance2, rhythmOfTime2, danceTypes2, danceTypePrints2, isDanceTypePrint2 };
@@ -3,7 +3,7 @@ import {
3
3
  matchNodes,
4
4
  candidateRelation,
5
5
  isDanceTypePrint2
6
- } from "./place-ng98cts4.js";
6
+ } from "./place-3pgn1jgx.js";
7
7
  import {
8
8
  validity
9
9
  } from "./place-q9kwsmzd.js";
@@ -5,7 +5,7 @@ import {
5
5
  candidateRelation,
6
6
  rhythmOfTime2,
7
7
  isDanceTypePrint2
8
- } from "./place-ng98cts4.js";
8
+ } from "./place-3pgn1jgx.js";
9
9
  import {
10
10
  validity
11
11
  } from "./place-q9kwsmzd.js";
@@ -1,14 +1,18 @@
1
1
  import {
2
2
  DANCE_TYPES2,
3
+ GRADE_DANCES2,
4
+ isGradeDance2,
3
5
  rhythmOfTime2,
4
6
  danceTypes2,
5
7
  danceTypePrints2,
6
8
  isDanceTypePrint2
7
- } from "./chunks/place-ng98cts4.js";
9
+ } from "./chunks/place-3pgn1jgx.js";
8
10
  export {
9
11
  DANCE_TYPES2 as DANCE_TYPES,
12
+ GRADE_DANCES2 as GRADE_DANCES,
10
13
  danceTypePrints2 as danceTypePrints,
11
14
  danceTypes2 as danceTypes,
12
15
  isDanceTypePrint2 as isDanceTypePrint,
16
+ isGradeDance2 as isGradeDance,
13
17
  rhythmOfTime2 as rhythmOfTime
14
18
  };
package/dist/dance.js CHANGED
@@ -1,10 +1,10 @@
1
- import"./chunks/place-ng98cts4.js";
1
+ import"./chunks/place-3pgn1jgx.js";
2
2
  import {
3
3
  ceili2
4
- } from "./chunks/place-gd57gavk.js";
4
+ } from "./chunks/place-3xxgddqw.js";
5
5
  import {
6
6
  tune2
7
- } from "./chunks/place-tpj00cfp.js";
7
+ } from "./chunks/place-4gycgaw0.js";
8
8
  import {
9
9
  validity
10
10
  } from "./chunks/place-q9kwsmzd.js";
package/dist/event.js ADDED
@@ -0,0 +1,231 @@
1
+ var EVENT_REGISTER = [
2
+ {
3
+ code: "ornc",
4
+ canonicalName: "Oireachtas Rince na Cruinne — Worlds",
5
+ tier: 1,
6
+ jurisdiction: "Global (target)",
7
+ naEligible: null
8
+ },
9
+ {
10
+ code: "ornh",
11
+ canonicalName: "Oireachtas Rince na hÉireann — All-Irelands",
12
+ tier: 2,
13
+ jurisdiction: "Ireland",
14
+ naEligible: false
15
+ },
16
+ {
17
+ code: "crn",
18
+ canonicalName: "Craobhacha Rince Náisiúnta — Irish Nationals",
19
+ tier: 2,
20
+ jurisdiction: "Ireland",
21
+ naEligible: false
22
+ },
23
+ {
24
+ code: "naidc",
25
+ canonicalName: "North American Nationals",
26
+ tier: 2,
27
+ jurisdiction: "IDTANA",
28
+ naEligible: true
29
+ },
30
+ {
31
+ code: "cnidc",
32
+ canonicalName: "Canadian National Irish Dance Championships",
33
+ tier: 2,
34
+ jurisdiction: "IDTANA (Can)",
35
+ naEligible: false
36
+ },
37
+ {
38
+ code: "gbc",
39
+ canonicalName: "Great Britain Championships",
40
+ tier: 2,
41
+ jurisdiction: "GB",
42
+ naEligible: false
43
+ },
44
+ {
45
+ code: "asc",
46
+ canonicalName: "All-Scotland Championships",
47
+ tier: 2,
48
+ jurisdiction: "Scotland",
49
+ naEligible: false
50
+ },
51
+ {
52
+ code: "brnat",
53
+ canonicalName: "British National Championships",
54
+ tier: 2,
55
+ jurisdiction: "GB",
56
+ naEligible: false
57
+ },
58
+ {
59
+ code: "nero",
60
+ canonicalName: "New England Region Oireachtas",
61
+ tier: 3,
62
+ jurisdiction: "IDTANA (US)",
63
+ naEligible: true
64
+ },
65
+ {
66
+ code: "maro",
67
+ canonicalName: "Mid-Atlantic Region Oireachtas",
68
+ tier: 3,
69
+ jurisdiction: "IDTANA (US)",
70
+ naEligible: true
71
+ },
72
+ {
73
+ code: "sro",
74
+ canonicalName: "Southern Region Oireachtas",
75
+ tier: 3,
76
+ jurisdiction: "IDTANA (US)",
77
+ naEligible: true
78
+ },
79
+ {
80
+ code: "mao",
81
+ canonicalName: "Mid-America Oireachtas",
82
+ tier: 3,
83
+ jurisdiction: "IDTANA (US)",
84
+ naEligible: true
85
+ },
86
+ {
87
+ code: "wusro",
88
+ canonicalName: "Western US Region Oireachtas",
89
+ tier: 3,
90
+ jurisdiction: "IDTANA (US)",
91
+ naEligible: true
92
+ },
93
+ {
94
+ code: "ecro",
95
+ canonicalName: "Eastern Canadian Oireachtas",
96
+ tier: 3,
97
+ jurisdiction: "IDTANA (Can)",
98
+ naEligible: true
99
+ },
100
+ {
101
+ code: "wcro",
102
+ canonicalName: "Western Canadian Region Oireachtas",
103
+ tier: 3,
104
+ jurisdiction: "IDTANA (Can)",
105
+ naEligible: true
106
+ },
107
+ {
108
+ code: "orl",
109
+ canonicalName: "Oir. Rince Laighean — Leinster",
110
+ tier: 3,
111
+ jurisdiction: "Ireland",
112
+ naEligible: false
113
+ },
114
+ {
115
+ code: "orm",
116
+ canonicalName: "Oir. Rince na Mumhan — Munster",
117
+ tier: 3,
118
+ jurisdiction: "Ireland",
119
+ naEligible: false
120
+ },
121
+ {
122
+ code: "oru",
123
+ canonicalName: "Oir. Rince Uladh — Ulster",
124
+ tier: 3,
125
+ jurisdiction: "Ireland",
126
+ naEligible: false
127
+ },
128
+ {
129
+ code: "orc",
130
+ canonicalName: "Oir. Rince Chonnacht — Connacht",
131
+ tier: 3,
132
+ jurisdiction: "Ireland",
133
+ naEligible: false
134
+ },
135
+ {
136
+ code: "sno",
137
+ canonicalName: "Scottish National Oireachtas",
138
+ tier: 3,
139
+ jurisdiction: "GB",
140
+ naEligible: false
141
+ },
142
+ {
143
+ code: "emid",
144
+ canonicalName: "England-Midlands (Lár na Breataine)",
145
+ tier: 3,
146
+ jurisdiction: "GB",
147
+ naEligible: false
148
+ },
149
+ {
150
+ code: "enw",
151
+ canonicalName: "England-North-West Oireachtas (NWRC)",
152
+ tier: 3,
153
+ jurisdiction: "GB",
154
+ naEligible: false
155
+ },
156
+ {
157
+ code: "ene",
158
+ canonicalName: "North East England Regional Oireachtas",
159
+ tier: 3,
160
+ jurisdiction: "GB",
161
+ naEligible: false
162
+ },
163
+ {
164
+ code: "seo",
165
+ canonicalName: "Southern England Oireachtas",
166
+ tier: 3,
167
+ jurisdiction: "GB",
168
+ naEligible: false
169
+ },
170
+ {
171
+ code: "rccea",
172
+ canonicalName: "Continental Europe & Asia Oireachtas",
173
+ tier: 3,
174
+ jurisdiction: "RCCEA",
175
+ naEligible: false
176
+ },
177
+ {
178
+ code: "tida",
179
+ canonicalName: "New Zealand National Championships",
180
+ tier: 2,
181
+ jurisdiction: "NZ",
182
+ naEligible: false
183
+ },
184
+ {
185
+ code: "aidc",
186
+ canonicalName: "Australian National Championships",
187
+ tier: 2,
188
+ jurisdiction: "Australia",
189
+ naEligible: false
190
+ },
191
+ {
192
+ code: "aio",
193
+ canonicalName: "Australian International Oireachtas",
194
+ tier: 2,
195
+ jurisdiction: "Australia",
196
+ naEligible: false
197
+ },
198
+ {
199
+ code: "rsa",
200
+ canonicalName: "South Africa Oireachtas",
201
+ tier: 3,
202
+ jurisdiction: "South Africa",
203
+ naEligible: false
204
+ },
205
+ {
206
+ code: "orsam",
207
+ canonicalName: "Oir. Rince An Meiriceá Theas — S. America",
208
+ tier: 3,
209
+ jurisdiction: "South America",
210
+ naEligible: false
211
+ }
212
+ ];
213
+ var EVENT_REGISTER_BY_CODE = new Map(EVENT_REGISTER.map((r) => [r.code, r]));
214
+ var EVENT_TIER = new Map(EVENT_REGISTER.map((r) => [r.code, r.tier]));
215
+ function eventTier(code) {
216
+ return EVENT_TIER.get(code) ?? null;
217
+ }
218
+ function isMajorEvent(code) {
219
+ return EVENT_TIER.has(code);
220
+ }
221
+ function eventCodeOfSlug(slug) {
222
+ return /^([a-z]+)\d{4}(?:[.\-]|$)/.exec(slug)?.[1] ?? null;
223
+ }
224
+ export {
225
+ EVENT_REGISTER,
226
+ EVENT_REGISTER_BY_CODE,
227
+ EVENT_TIER,
228
+ eventCodeOfSlug,
229
+ eventTier,
230
+ isMajorEvent
231
+ };
package/dist/tune.js CHANGED
@@ -8,8 +8,8 @@ import {
8
8
  settingAt2,
9
9
  tune2,
10
10
  tuneRelation2
11
- } from "./chunks/place-tpj00cfp.js";
12
- import"./chunks/place-ng98cts4.js";
11
+ } from "./chunks/place-4gycgaw0.js";
12
+ import"./chunks/place-3pgn1jgx.js";
13
13
  export {
14
14
  PLAUSIBLE_SET_TEMPO_MAX2 as PLAUSIBLE_SET_TEMPO_MAX,
15
15
  SET_MIN_SPEED2 as SET_MIN_SPEED,
@@ -1,6 +1,9 @@
1
1
  export type { DanceMatch, DanceRelation } from "./dance-match.ts";
2
2
  export type DanceType = "reel" | "light-jig" | "single-jig" | "slip-jig" | "treble-jig" | "hornpipe" | "traditional-set" | "set-dance";
3
3
  export declare const DANCE_TYPES: readonly DanceType[];
4
+ export type GradeDance = Exclude<DanceType, "traditional-set" | "set-dance">;
5
+ export declare const GRADE_DANCES: readonly GradeDance[];
6
+ export declare function isGradeDance(d: string | null | undefined): d is GradeDance;
4
7
  export type TimeSignature = "2/4" | "4/4" | "6/8" | "9/8" | "6/8+9/8";
5
8
  export type SetRhythm = "jig" | "hornpipe";
6
9
  export declare function rhythmOfTime(time: TimeSignature): SetRhythm;
@@ -0,0 +1,13 @@
1
+ export interface EventRegisterRow {
2
+ code: string;
3
+ canonicalName: string;
4
+ tier: 1 | 2 | 3;
5
+ jurisdiction: string;
6
+ naEligible: boolean | null;
7
+ }
8
+ export declare const EVENT_REGISTER: readonly EventRegisterRow[];
9
+ export declare const EVENT_REGISTER_BY_CODE: ReadonlyMap<string, EventRegisterRow>;
10
+ export declare const EVENT_TIER: ReadonlyMap<string, 1 | 2 | 3>;
11
+ export declare function eventTier(code: string): 1 | 2 | 3 | null;
12
+ export declare function isMajorEvent(code: string): boolean;
13
+ export declare function eventCodeOfSlug(slug: string): string | null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@finbheara/domain",
3
- "version": "0.52.0",
4
- "description": "Places, CLRG regions, school names, ages, dances, competition titles, codes and schedules, and a person's print in its role, as they are printed: read, compared and told apart",
3
+ "version": "0.54.0",
4
+ "description": "Places, CLRG regions and events, school names, ages, dances, competition titles, codes and schedules, and a person's print in its role, as they are printed: read, compared and told apart",
5
5
  "keywords": [
6
6
  "places",
7
7
  "regions",
@@ -77,6 +77,10 @@
77
77
  "types": "./dist/types/code.d.ts",
78
78
  "default": "./dist/code.js"
79
79
  },
80
+ "./event": {
81
+ "types": "./dist/types/event.d.ts",
82
+ "default": "./dist/event.js"
83
+ },
80
84
  "./package.json": "./package.json"
81
85
  },
82
86
  "files": ["dist/*.js", "dist/chunks/*.js", "dist/types/**/*.d.ts", "README.md", "LICENSE"],
@@ -93,7 +97,7 @@
93
97
  "prepublishOnly": "bun scripts/build.ts && bun scripts/guard-tarball.ts"
94
98
  },
95
99
  "dependencies": {
96
- "@finbheara/names": "0.25.0"
100
+ "@finbheara/names": "0.26.0"
97
101
  },
98
102
  "devDependencies": {
99
103
  "typescript": "7.0.2"