@taekwondo-db/database 0.7.0 → 0.8.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.
Files changed (96) hide show
  1. package/README.md +73 -11
  2. package/audio/poomsae/chonkwon.mp3 +0 -0
  3. package/audio/poomsae/hansu.mp3 +0 -0
  4. package/audio/poomsae/ilyeo.mp3 +0 -0
  5. package/audio/poomsae/jitae.mp3 +0 -0
  6. package/audio/poomsae/keumgang.mp3 +0 -0
  7. package/audio/poomsae/koryo.mp3 +0 -0
  8. package/audio/poomsae/pyongwon.mp3 +0 -0
  9. package/audio/poomsae/shipjin.mp3 +0 -0
  10. package/audio/poomsae/taebaek.mp3 +0 -0
  11. package/audio/poomsae/taegeuk-1jang.mp3 +0 -0
  12. package/audio/poomsae/taegeuk-2jang.mp3 +0 -0
  13. package/audio/poomsae/taegeuk-3jang.mp3 +0 -0
  14. package/audio/poomsae/taegeuk-4jang.mp3 +0 -0
  15. package/audio/poomsae/taegeuk-5jang.mp3 +0 -0
  16. package/audio/poomsae/taegeuk-6jang.mp3 +0 -0
  17. package/audio/poomsae/taegeuk-7jang.mp3 +0 -0
  18. package/audio/poomsae/taegeuk-8jang.mp3 +0 -0
  19. package/db/chagi.json +44 -543
  20. package/db/chigi.json +24 -33
  21. package/db/ditgi.json +8 -92
  22. package/db/jireugi.json +9 -44
  23. package/db/jjireugi.json +8 -21
  24. package/db/junbijase.json +7 -1
  25. package/db/kkeokgi.json +4 -20
  26. package/db/makgi.json +68 -10
  27. package/db/poomsae/1-taegeuk-1jang.json +214 -0
  28. package/db/poomsae/2-taegeuk-2jang.json +227 -0
  29. package/db/poomsae/3-taegeuk-3jang.json +256 -0
  30. package/db/poomsae/4-taegeuk-4jang.json +267 -0
  31. package/db/poomsae/5-taegeuk-5jang.json +291 -0
  32. package/db/poomsae/6-taegeuk-6jang.json +292 -0
  33. package/db/poomsae/7-taegeuk-7jang.json +342 -0
  34. package/db/poomsae/8-taegeuk-8jang.json +377 -0
  35. package/db/poomsae/a-koryo.json +458 -0
  36. package/db/poomsae/b-keumgang.json +292 -0
  37. package/db/poomsae/c-taebaek.json +332 -0
  38. package/db/poomsae/d-pyongwon.json +289 -0
  39. package/db/poomsae/e-shipjin.json +301 -0
  40. package/db/poomsae/f-jitae.json +326 -0
  41. package/db/poomsae/g-chonkwon.json +340 -0
  42. package/db/poomsae/h-hansu.json +332 -0
  43. package/db/poomsae/i-ilyeo.json +287 -0
  44. package/db/schemas/grades.json +2 -2
  45. package/db/schemas/include.json +11 -0
  46. package/db/schemas/poomsae.json +221 -0
  47. package/db/seogi.json +24 -34
  48. package/db/sources.json +7 -0
  49. package/package.json +1 -1
  50. package/src/builtins-empty.js +1 -0
  51. package/src/builtins.d.ts +2 -0
  52. package/src/builtins.js +55 -0
  53. package/src/compose-builtins.js +2 -0
  54. package/src/compose.d.ts +10 -2
  55. package/src/compose.js +52 -7
  56. package/src/database.ts +143 -4
  57. package/src/grade.d.ts +3 -2
  58. package/types/poomsae.d.ts +136 -0
  59. package/types/source.d.ts +4 -1
  60. package/types/technique.d.ts +4 -0
  61. package/audio/chagi/apbal-bada-meori-dollyeochagi.mp3 +0 -0
  62. package/audio/chagi/apbal-jejari-dollyeochagi.mp3 +0 -0
  63. package/audio/chagi/apbal-kkeureo-dollyeochagi.mp3 +0 -0
  64. package/audio/chagi/balbutyeo-dollyeochagi.mp3 +0 -0
  65. package/audio/chagi/balbutyeo-naeryeochagi.mp3 +0 -0
  66. package/audio/chagi/dwi-gongjung-yangbal-apchagi.mp3 +0 -0
  67. package/audio/chagi/eolgul-pyojeok-anchagi.mp3 +0 -0
  68. package/audio/chagi/gaseum-ditgo-dwi-gongjung-apchagi.mp3 +0 -0
  69. package/audio/chagi/gaseum-ditgo-dwi-gongjung-yangbal-apchagi.mp3 +0 -0
  70. package/audio/chagi/geodeup-apchagi.mp3 +0 -0
  71. package/audio/chagi/geodeup-dollyeochagi.mp3 +0 -0
  72. package/audio/chagi/geodeup-yeopchagi.mp3 +0 -0
  73. package/audio/chagi/jase-bakkwo-dollyeochagi.mp3 +0 -0
  74. package/audio/chagi/mo-gongjung-dora-apchagi.mp3 +0 -0
  75. package/audio/chagi/mo-gongjung-dora-dwihuryeochagi.mp3 +0 -0
  76. package/audio/chagi/modumbal-apchagi.mp3 +0 -0
  77. package/audio/chagi/nun-garigo-ttwieo-dolgaechagi.mp3 +0 -0
  78. package/audio/chagi/oebal-dolgaechagi.mp3 +0 -0
  79. package/audio/chagi/ttwieo-360-hwejeonhamyeo-pyojeok-anchagi.mp3 +0 -0
  80. package/audio/chagi/ttwieo-apchagi.mp3 +0 -0
  81. package/audio/chagi/ttwieo-dollyeochagi.mp3 +0 -0
  82. package/audio/chagi/ttwieo-dwichagi.mp3 +0 -0
  83. package/audio/chagi/ttwieo-dwihuryeochagi.mp3 +0 -0
  84. package/audio/chagi/ttwieo-yeopchagi.mp3 +0 -0
  85. package/audio/chagi/tucheok-dwi-gongjung-dora-apchagi.mp3 +0 -0
  86. package/audio/chigi/eolgul-batangson-apchigi.mp3 +0 -0
  87. package/audio/ditgi/apbal-naeditgi.mp3 +0 -0
  88. package/audio/ditgi/balbutyeo-naeditgi.mp3 +0 -0
  89. package/audio/ditgi/du-bal-naeditgi.mp3 +0 -0
  90. package/audio/ditgi/dwitbal-naeditgi.mp3 +0 -0
  91. package/audio/ditgi/jase-bakkwo-ditgi.mp3 +0 -0
  92. package/audio/jireugi/pyojeok-yeopjireugi.mp3 +0 -0
  93. package/audio/jireugi/teok-danggyeojireugi.mp3 +0 -0
  94. package/audio/jjireugi/arae-jeotyeojjireugi.mp3 +0 -0
  95. package/audio/kkeokgi/mureup-nulleokkeokgi.mp3 +0 -0
  96. package/audio/seogi/mo-juchumseogi.mp3 +0 -0
@@ -0,0 +1,221 @@
1
+ {
2
+ "$id": "schemas/poomsae.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "additionalProperties": {
5
+ "additionalProperties": false,
6
+ "properties": {
7
+ "description": {
8
+ "$ref": "./localized-string.json",
9
+ "description": "Free-form notes on the Poomsae as a whole, e.g. what it practises; may reference techniques and terms. Need not cover every language."
10
+ },
11
+ "diagram": { "$ref": "#/definitions/diagram" },
12
+ "hangeul": {
13
+ "description": "The name in Hangeul",
14
+ "minLength": 1,
15
+ "type": "string"
16
+ },
17
+ "movements": {
18
+ "description": "The course of the Poomsae in order; the first movement is Junbi, the last Baro.",
19
+ "items": { "$ref": "#/definitions/movement" },
20
+ "minItems": 1,
21
+ "type": "array"
22
+ },
23
+ "pronunciation": { "$ref": "./pronunciation.json" },
24
+ "sources": {
25
+ "description": "Where the course is described, e.g. a page of the Kukkiwon's textbook.",
26
+ "items": { "$ref": "./source.json" },
27
+ "type": "array"
28
+ },
29
+ "supplementaryName": {
30
+ "description": "The name in Revised Romanization, where it differs from the key.",
31
+ "minLength": 1,
32
+ "type": "string"
33
+ },
34
+ "videos": {
35
+ "items": {
36
+ "additionalProperties": false,
37
+ "properties": {
38
+ "link": { "minLength": 1, "type": "string" },
39
+ "name": { "minLength": 1, "type": "string" }
40
+ },
41
+ "required": ["link", "name"],
42
+ "type": "object"
43
+ },
44
+ "type": "array"
45
+ }
46
+ },
47
+ "required": ["hangeul", "movements"],
48
+ "type": "object"
49
+ },
50
+ "definitions": {
51
+ "actionTechnique": {
52
+ "additionalProperties": false,
53
+ "anyOf": [{ "required": ["$ref"] }, { "required": ["name"] }],
54
+ "properties": {
55
+ "$ref": {
56
+ "description": "A technique of the database",
57
+ "minLength": 1,
58
+ "type": "string"
59
+ },
60
+ "eyeDir": {
61
+ "$ref": "#/definitions/direction",
62
+ "description": "Where the technique looks, if not where the movement does — e.g. a kick toward Ga before turning to Da②. Not part of the Kukkiwon's table; omitted means the eye direction of the movement."
63
+ },
64
+ "inPlace": {
65
+ "description": "This technique takes no step: it is executed where the step before ended — e.g. Apchagi in Ilyeo 19. Not part of the Kukkiwon's table; omitted means the default, a step.",
66
+ "type": "boolean"
67
+ },
68
+ "kihap": {
69
+ "description": "This technique is accompanied by a Kihap. Omitted means false.",
70
+ "type": "boolean"
71
+ },
72
+ "name": {
73
+ "description": "The name used in the Poomsae. Without $ref: a technique the database does not have; with $ref: a variant the referenced technique covers, e.g. Ttwieo Yeopchagi for Ttwieochagi.",
74
+ "minLength": 1,
75
+ "type": "string"
76
+ },
77
+ "side": {
78
+ "$ref": "#/definitions/side",
79
+ "description": "The side that executes the technique, or of the stance. Omitted if there is no such side."
80
+ }
81
+ },
82
+ "type": "object"
83
+ },
84
+ "diagram": {
85
+ "additionalProperties": false,
86
+ "description": "The Poomsae line, seen from above: Na at the top, Ga at the bottom, Da on the right. x grows toward Da, y toward Ga.",
87
+ "properties": {
88
+ "lines": {
89
+ "description": "The line, drawn as polylines through the points.",
90
+ "items": {
91
+ "items": { "$ref": "#/definitions/direction" },
92
+ "minItems": 2,
93
+ "type": "array"
94
+ },
95
+ "minItems": 1,
96
+ "type": "array"
97
+ },
98
+ "points": {
99
+ "additionalProperties": {
100
+ "items": { "type": "number" },
101
+ "maxItems": 2,
102
+ "minItems": 2,
103
+ "type": "array"
104
+ },
105
+ "description": "Where each point lies, as [x, y]. A point off the lines, such as Ga of Pyongwon, only marks a direction. Every position of the movements must be a point; an eye direction may also be a bare direction such as Ga.",
106
+ "propertyNames": { "$ref": "#/definitions/direction" },
107
+ "type": "object"
108
+ }
109
+ },
110
+ "required": ["lines", "points"],
111
+ "type": "object"
112
+ },
113
+ "direction": {
114
+ "description": "A point of the Poomsae line.",
115
+ "pattern": "^(Ga|Na|Da|Ra|Ma)[①②③]?$",
116
+ "type": "string"
117
+ },
118
+ "movement": {
119
+ "additionalProperties": false,
120
+ "properties": {
121
+ "action": {
122
+ "description": "The techniques — kicks, blocks, stances passed through — executed on the way, in order.",
123
+ "items": { "$ref": "#/definitions/actionTechnique" },
124
+ "minItems": 1,
125
+ "type": "array"
126
+ },
127
+ "eyeDir": {
128
+ "$ref": "#/definitions/direction",
129
+ "description": "The eye direction."
130
+ },
131
+ "inPlace": {
132
+ "description": "true: the movement takes no step — it is executed where the movement before ended, its position only naming the direction it faces, e.g. Geumgangmakgi in Ilyeo. false: it takes a step even where it only turns to look elsewhere. Not part of the Kukkiwon's table; omitted means the default, a step unless it only turns to look elsewhere at the same position.",
133
+ "type": "boolean"
134
+ },
135
+ "kihap": {
136
+ "description": "The movement is accompanied by a Kihap. Omitted means false.",
137
+ "type": "boolean"
138
+ },
139
+ "nameOfPoom": {
140
+ "description": "The techniques the movement is named after.",
141
+ "items": { "$ref": "#/definitions/technique" },
142
+ "minItems": 1,
143
+ "type": "array"
144
+ },
145
+ "note": {
146
+ "$ref": "./localized-string.json",
147
+ "description": "What is special about the movement, e.g. which hand does what; may reference techniques and terms."
148
+ },
149
+ "order": {
150
+ "description": "The number of the movement; Junbi first, Baro last.",
151
+ "oneOf": [
152
+ { "enum": ["Junbi", "Baro"] },
153
+ { "minimum": 1, "type": "integer" }
154
+ ]
155
+ },
156
+ "position": {
157
+ "$ref": "#/definitions/direction",
158
+ "description": "Where the movement ends."
159
+ },
160
+ "stance": {
161
+ "additionalProperties": false,
162
+ "description": "The stance the movement ends in.",
163
+ "oneOf": [{ "required": ["$ref"] }, { "required": ["name"] }],
164
+ "properties": {
165
+ "$ref": {
166
+ "description": "A technique of the database",
167
+ "minLength": 1,
168
+ "type": "string"
169
+ },
170
+ "name": {
171
+ "description": "The name of a stance the database does not have",
172
+ "minLength": 1,
173
+ "type": "string"
174
+ },
175
+ "side": {
176
+ "$ref": "#/definitions/side",
177
+ "description": "As the Kukkiwon names the stance: the foot in front or crossing, but the supporting leg of Dwitgubi and of stances on one leg. Omitted if it names none."
178
+ }
179
+ },
180
+ "type": "object"
181
+ }
182
+ },
183
+ "required": ["order", "eyeDir", "position", "nameOfPoom"],
184
+ "type": "object"
185
+ },
186
+ "side": {
187
+ "description": "Apps may show it in Korean: Wen (left), Oreun (right).",
188
+ "enum": ["left", "right"]
189
+ },
190
+ "technique": {
191
+ "additionalProperties": false,
192
+ "anyOf": [{ "required": ["$ref"] }, { "required": ["name"] }],
193
+ "properties": {
194
+ "$ref": {
195
+ "description": "A technique of the database",
196
+ "minLength": 1,
197
+ "type": "string"
198
+ },
199
+ "inPlace": {
200
+ "description": "This technique takes no step: it is executed where the step before ended — e.g. the block landing from Ttwieochagi in Ilyeo 19. Not part of the Kukkiwon's table; omitted means the default, a step.",
201
+ "type": "boolean"
202
+ },
203
+ "name": {
204
+ "description": "The name used in the Poomsae. Without $ref: a technique the database does not have; with $ref: a variant the referenced technique covers, e.g. Ttwieo Yeopchagi for Ttwieochagi.",
205
+ "minLength": 1,
206
+ "type": "string"
207
+ },
208
+ "side": {
209
+ "$ref": "#/definitions/side",
210
+ "description": "The side that executes the technique. Omitted if there is no such side."
211
+ }
212
+ },
213
+ "type": "object"
214
+ }
215
+ },
216
+ "description": "Keyed by the name as the Kukkiwon writes it, e.g. \"Taegeuk 1Jang\" or \"Koryo\".",
217
+ "properties": { "$schema": { "type": "string" } },
218
+ "propertyNames": { "minLength": 1, "type": "string" },
219
+ "title": "Poomsae",
220
+ "type": "object"
221
+ }
package/db/seogi.json CHANGED
@@ -49,6 +49,12 @@
49
49
  { "$ref": "./terms.json#/seogi" }
50
50
  ],
51
51
  "translation": { "de": "Vorderer Kreuzstand", "en": "Front cross stance" },
52
+ "videos": [
53
+ {
54
+ "link": "https://youtu.be/Gr_Je2ZkgkI?t=534",
55
+ "name": "Poomsae: Taegeuk 8Jang"
56
+ }
57
+ ],
52
58
  "weight": { "back": 90, "front": 10 }
53
59
  },
54
60
  "Apseogi": {
@@ -129,6 +135,12 @@
129
135
  { "$ref": "./terms.json#/seogi" }
130
136
  ],
131
137
  "translation": { "de": "Hinterer Kreuzstand", "en": "Back cross stance" },
138
+ "videos": [
139
+ {
140
+ "link": "https://youtu.be/VdqNEAHWCBM?t=277",
141
+ "name": "Poomsae: Taegeuk 5Jang"
142
+ }
143
+ ],
132
144
  "weight": { "back": 90, "front": 10 }
133
145
  },
134
146
  "Dwitgubi": {
@@ -218,8 +230,8 @@
218
230
  },
219
231
  "Juchumseogi": {
220
232
  "description": {
221
- "de": "Die Füße sind etwa zwei Fußlängen geöffnet, die Knie werden nach innen gedrückt und der Schwerpunkt liegt tief. Bietet hohe Stabilität für Abwehr und Angriff, trainiert die Hüftbeweglichkeit und hilft, das Gleichgewicht in alle Richtungen zu halten. Gilt als wichtigster Stand des Taekwondo.",
222
- "en": "The feet are set about two foot lengths apart, the knees are pressed inward and the centre of gravity is low. It gives high stability for defence and attack, trains waist flexibility, and helps maintain balance in all directions. Regarded as the most important stance in Taekwondo."
233
+ "de": "Die Füße sind etwa zwei Fußlängen geöffnet, die Knie werden nach innen gedrückt und der Schwerpunkt liegt tief. Bietet hohe Stabilität für Abwehr und Angriff, trainiert die Hüftbeweglichkeit und hilft, das Gleichgewicht in alle Richtungen zu halten. Gilt als wichtigster Stand des Taekwondo. Varianten: Mo Juchumseogi (Diagonaler Reiterstand).",
234
+ "en": "The feet are set about two foot lengths apart, the knees are pressed inward and the centre of gravity is low. It gives high stability for defence and attack, trains waist flexibility, and helps maintain balance in all directions. Regarded as the most important stance in Taekwondo. Variants: Mo Juchumseogi (Diagonal horse riding stance)."
223
235
  },
224
236
  "historic": [
225
237
  {
@@ -234,7 +246,8 @@
234
246
  "images": [{ "ai": true, "src": "seogi/juchumseogi-front.jpg" }],
235
247
  "pronunciation": { "ai": true, "src": "seogi/juchumseogi.mp3" },
236
248
  "sources": [
237
- { "$ref": "./sources.json#/kukkiwon_2022_book_2", "page": "80" }
249
+ { "$ref": "./sources.json#/kukkiwon_2022_book_2", "page": "80" },
250
+ { "$ref": "./sources.json#/kukkiwon_2022_book_2", "page": "252" }
238
251
  ],
239
252
  "terms": [
240
253
  { "$ref": "./terms.json#/juchum" },
@@ -292,31 +305,8 @@
292
305
  { "$ref": "./terms.json#/seogi" }
293
306
  ],
294
307
  "translation": { "de": "Kreuzstand", "en": "Cross stance" },
295
- "videos": [
296
- {
297
- "link": "https://youtu.be/VdqNEAHWCBM?t=277",
298
- "name": "Poomsae: Taegeuk 5Jang"
299
- }
300
- ],
301
308
  "weight": { "back": 90, "front": 10 }
302
309
  },
303
- "Mo Juchumseogi": {
304
- "pronunciation": { "ai": true, "src": "seogi/mo-juchumseogi.mp3" },
305
- "references": [{ "$ref": "#/Juchumseogi", "type": "generic" }],
306
- "sources": [
307
- { "$ref": "./sources.json#/kukkiwon_2022_book_2", "page": "252" }
308
- ],
309
- "terms": [
310
- { "$ref": "./terms.json#/mo" },
311
- { "$ref": "./terms.json#/$space" },
312
- { "$ref": "./terms.json#/juchum" },
313
- { "$ref": "./terms.json#/seogi" }
314
- ],
315
- "translation": {
316
- "de": "Diagonaler Reiterstand",
317
- "en": "Diagonal horse riding stance"
318
- }
319
- },
320
310
  "Moaseogi": {
321
311
  "description": {
322
312
  "de": "Die Füße stehen geschlossen, ihre Innenkanten berühren sich, die Knie sind gestreckt. Dient am Anfang oder Ende der Poomsae der Konzentration und ist eine Organisationsstellung, die auch zur Entwicklung der Beinkraft durch schnelle Drehungen genutzt wird.",
@@ -332,6 +322,12 @@
332
322
  { "$ref": "./terms.json#/seogi" }
333
323
  ],
334
324
  "translation": { "de": "Geschlossener Stand", "en": "Closed stance" },
325
+ "videos": [
326
+ {
327
+ "link": "https://youtu.be/RB-7mBtvtZw?t=375",
328
+ "name": "Poomsae: Pyeongwon"
329
+ }
330
+ ],
335
331
  "weight": { "back": 50, "front": 50 }
336
332
  },
337
333
  "Moseogi": {
@@ -351,13 +347,7 @@
351
347
  "translation": {
352
348
  "de": "Schräg gerichtete Stellung",
353
349
  "en": "Diagonal stance"
354
- },
355
- "videos": [
356
- {
357
- "link": "https://youtu.be/RB-7mBtvtZw?t=375",
358
- "name": "Poomsae: Pyeongwon"
359
- }
360
- ]
350
+ }
361
351
  },
362
352
  "Naranhiseogi": {
363
353
  "description": {
@@ -421,7 +411,7 @@
421
411
  "en": "Reverse crane stance"
422
412
  },
423
413
  "videos": [
424
- { "link": "https://youtu.be/jWClKVOrqJ8?t=148", "name": "Poomsae: Ilyeo" }
414
+ { "link": "https://youtu.be/jWClKVOrqJ8?t=238", "name": "Poomsae: Ilyeo" }
425
415
  ]
426
416
  },
427
417
  "Oreunseogi": {
package/db/sources.json CHANGED
@@ -25,5 +25,12 @@
25
25
  "title": "Taekwondo Textbook - 2 Basic",
26
26
  "type": "book",
27
27
  "year": 2022
28
+ },
29
+ "kukkiwon_2022_book_3": {
30
+ "author": "Kukkiwon",
31
+ "isbn": "9791191659085",
32
+ "title": "Taekwondo Textbook - 3 Poomsae",
33
+ "type": "book",
34
+ "year": 2022
28
35
  }
29
36
  }
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  },
50
50
  "type": "module",
51
51
  "types": "./src/database.ts",
52
- "version": "0.7.0"
52
+ "version": "0.8.0"
53
53
  }
@@ -6,5 +6,6 @@
6
6
  * bundled Kukkiwon JSON out of a derived app's bundle.
7
7
  */
8
8
  export const builtinTechniqueGroups = {};
9
+ export const builtinPoomsae = {};
9
10
  export const builtinTerms = {};
10
11
  export const builtinSources = {};
package/src/builtins.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { PoomsaeJson } from "../types/poomsae";
1
2
  import type { SourcesJson } from "../types/source";
2
3
  import type { BuiltinTechniqueGroup, TechniqueJson } from "../types/technique";
3
4
  import type { TermJson } from "../types/term";
@@ -6,5 +7,6 @@ export declare const builtinTechniqueGroups: Record<
6
7
  BuiltinTechniqueGroup,
7
8
  Record<string, TechniqueJson | string>
8
9
  >;
10
+ export declare const builtinPoomsae: PoomsaeJson;
9
11
  export declare const builtinTerms: Record<string, TermJson | string>;
10
12
  export declare const builtinSources: SourcesJson;
package/src/builtins.js CHANGED
@@ -21,6 +21,40 @@ import milgi from "../db/milgi.json" with { type: "json" };
21
21
  import nakbeop from "../db/nakbeop.json" with { type: "json" };
22
22
  import neomgigi from "../db/neomgigi.json" with { type: "json" };
23
23
  import pihagi from "../db/pihagi.json" with { type: "json" };
24
+ // Poomsae, in the order of their file names.
25
+ import taegeuk1jang from "../db/poomsae/1-taegeuk-1jang.json" with {
26
+ type: "json",
27
+ };
28
+ import taegeuk2jang from "../db/poomsae/2-taegeuk-2jang.json" with {
29
+ type: "json",
30
+ };
31
+ import taegeuk3jang from "../db/poomsae/3-taegeuk-3jang.json" with {
32
+ type: "json",
33
+ };
34
+ import taegeuk4jang from "../db/poomsae/4-taegeuk-4jang.json" with {
35
+ type: "json",
36
+ };
37
+ import taegeuk5jang from "../db/poomsae/5-taegeuk-5jang.json" with {
38
+ type: "json",
39
+ };
40
+ import taegeuk6jang from "../db/poomsae/6-taegeuk-6jang.json" with {
41
+ type: "json",
42
+ };
43
+ import taegeuk7jang from "../db/poomsae/7-taegeuk-7jang.json" with {
44
+ type: "json",
45
+ };
46
+ import taegeuk8jang from "../db/poomsae/8-taegeuk-8jang.json" with {
47
+ type: "json",
48
+ };
49
+ import koryo from "../db/poomsae/a-koryo.json" with { type: "json" };
50
+ import keumgang from "../db/poomsae/b-keumgang.json" with { type: "json" };
51
+ import taebaek from "../db/poomsae/c-taebaek.json" with { type: "json" };
52
+ import pyongwon from "../db/poomsae/d-pyongwon.json" with { type: "json" };
53
+ import shipjin from "../db/poomsae/e-shipjin.json" with { type: "json" };
54
+ import jitae from "../db/poomsae/f-jitae.json" with { type: "json" };
55
+ import chonkwon from "../db/poomsae/g-chonkwon.json" with { type: "json" };
56
+ import hansu from "../db/poomsae/h-hansu.json" with { type: "json" };
57
+ import ilyeo from "../db/poomsae/i-ilyeo.json" with { type: "json" };
24
58
  import ppaegi from "../db/ppaegi.json" with { type: "json" };
25
59
  import seogi from "../db/seogi.json" with { type: "json" };
26
60
  import sources from "../db/sources.json" with { type: "json" };
@@ -46,5 +80,26 @@ export const builtinTechniqueGroups = {
46
80
  ttwigi,
47
81
  };
48
82
 
83
+ /** Merged in the order of the file names, which is the order they are learned in. */
84
+ export const builtinPoomsae = Object.assign(
85
+ {},
86
+ taegeuk1jang,
87
+ taegeuk2jang,
88
+ taegeuk3jang,
89
+ taegeuk4jang,
90
+ taegeuk5jang,
91
+ taegeuk6jang,
92
+ taegeuk7jang,
93
+ taegeuk8jang,
94
+ koryo,
95
+ keumgang,
96
+ taebaek,
97
+ pyongwon,
98
+ shipjin,
99
+ jitae,
100
+ chonkwon,
101
+ hansu,
102
+ ilyeo,
103
+ );
49
104
  export const builtinTerms = terms;
50
105
  export const builtinSources = sources;
@@ -8,6 +8,7 @@
8
8
  */
9
9
  import { fileURLToPath } from "node:url";
10
10
  import {
11
+ builtinPoomsae,
11
12
  builtinSources,
12
13
  builtinTechniqueGroups,
13
14
  builtinTerms,
@@ -36,6 +37,7 @@ export function composeDatabase(options = {}) {
36
37
  options.includeBuiltins === false
37
38
  ? NO_BUILTINS
38
39
  : {
40
+ poomsae: builtinPoomsae,
39
41
  sources: builtinSources,
40
42
  techniqueGroups: builtinTechniqueGroups,
41
43
  terms: builtinTerms,
package/src/compose.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { PoomsaeEntryJson, PoomsaeJson } from "../types/poomsae";
1
2
  import type { SourcesJson } from "../types/source";
2
3
  import type {
3
4
  CustomTechniqueJson,
@@ -15,6 +16,8 @@ export interface Include {
15
16
  techniques?: Record<string, string[] | "*">;
16
17
  /** Builtin terms to load although no included technique uses them. */
17
18
  terms?: string[];
19
+ /** Builtin Poomsae in display order; `"*"` for all. None if omitted. */
20
+ poomsae?: string[] | "*";
18
21
  }
19
22
 
20
23
  export interface ComposeOptions {
@@ -32,24 +35,29 @@ export interface ComposeOptions {
32
35
  techniqueGroups?: Record<string, TechniqueGroupJson> | null;
33
36
  /** Own techniques that carry their own `group`. */
34
37
  customTechniques?: CustomTechniqueJson | null;
38
+ /** Own Poomsae; replace builtin ones with the same key. */
39
+ poomsae?: PoomsaeJson | null;
35
40
  /** Changes to existing techniques; see {@link applyPatch}. */
36
41
  patchTechniques?: PatchTechniqueJson | null;
37
42
  /** Changes to existing terms; see {@link applyPatch}. */
38
43
  patchTerms?: PatchTermJson | null;
39
44
  /**
40
- * From which grade on a technique is relevant, e.g. `{ "9-kup": ["Apchagi"] }`.
41
- * Every technique listed must be loaded, and listed only once.
45
+ * From which grade on a technique or Poomsae is relevant, e.g.
46
+ * `{ "8-kup": ["Taegeuk 1Jang", "Apchagi"] }`. Every technique and Poomsae
47
+ * listed must be loaded, and listed only once.
42
48
  */
43
49
  grades?: GradesJson | null;
44
50
  }
45
51
 
46
52
  export interface Builtins {
53
+ poomsae?: PoomsaeJson;
47
54
  sources: SourcesJson | Record<string, unknown>;
48
55
  techniqueGroups: Record<string, TechniqueGroupJson>;
49
56
  terms: Record<string, TermJson | string>;
50
57
  }
51
58
 
52
59
  export interface ComposedDatabase {
60
+ poomsae: Record<string, PoomsaeEntryJson>;
53
61
  sources: SourcesJson;
54
62
  techniqueGroups: Record<string, Record<string, TechniqueJson>>;
55
63
  customTechniques: Record<string, TechniqueJson>;
package/src/compose.js CHANGED
@@ -12,6 +12,7 @@ import { compareGrades, parseGrade } from "./grade.js";
12
12
 
13
13
  /** Builtins of a database built with `includeBuiltins: false`. */
14
14
  export const NO_BUILTINS = Object.freeze({
15
+ poomsae: {},
15
16
  sources: {},
16
17
  techniqueGroups: {},
17
18
  terms: {},
@@ -196,7 +197,41 @@ export function composeDatabase(options, builtins) {
196
197
  }
197
198
  }
198
199
 
199
- // 4. Terms. Own terms replace builtin ones with the same key.
200
+ // 4. Poomsae. Own ones replace builtin ones with the same key. Techniques
201
+ // that were left out stay as plain names, so the course is complete.
202
+ const builtinPoomsae = Object.fromEntries(entries(builtins.poomsae));
203
+ /** @type {Record<string, object>} */
204
+ const poomsae = {};
205
+ const pickedPoomsae = include ? (include.poomsae ?? []) : "*";
206
+ for (const name of pickedPoomsae === "*"
207
+ ? Object.keys(builtinPoomsae)
208
+ : pickedPoomsae) {
209
+ if (!builtinPoomsae[name]) {
210
+ throw new Error(`include: unknown Poomsae "${name}"`);
211
+ }
212
+ poomsae[name] = structuredClone(builtinPoomsae[name]);
213
+ }
214
+ for (const [name, entry] of entries(options.poomsae)) {
215
+ poomsae[name] = structuredClone(entry);
216
+ }
217
+ if (include) {
218
+ const dropRef = (part) => {
219
+ if (!part?.$ref) return;
220
+ const key = refKey(part);
221
+ if (groupOf.has(key) || !builtinNames.has(key)) return;
222
+ delete part.$ref;
223
+ part.name ??= key;
224
+ };
225
+ for (const { movements } of Object.values(poomsae)) {
226
+ for (const movement of movements) {
227
+ dropRef(movement.stance);
228
+ for (const part of movement.action ?? []) dropRef(part);
229
+ for (const part of movement.nameOfPoom) dropRef(part);
230
+ }
231
+ }
232
+ }
233
+
234
+ // 5. Terms. Own terms replace builtin ones with the same key.
200
235
  const termPool = Object.fromEntries(entries(builtins.terms));
201
236
  for (const [key, term] of entries(options.terms)) termPool[key] = term;
202
237
 
@@ -245,7 +280,7 @@ export function composeDatabase(options, builtins) {
245
280
  terms[key] = applyPatch(terms[key], patch, `${key}.`);
246
281
  }
247
282
 
248
- // 5. Sources. Own sources replace builtin ones with the same key.
283
+ // 6. Sources. Own sources replace builtin ones with the same key.
249
284
  /** @type {Record<string, object>} */
250
285
  let sources;
251
286
  if (include) {
@@ -262,6 +297,9 @@ export function composeDatabase(options, builtins) {
262
297
  }
263
298
  }
264
299
  for (const term of Object.values(terms)) collectHistoric(term.historic);
300
+ for (const entry of Object.values(poomsae)) {
301
+ for (const source of entry.sources ?? []) used.add(refKey(source));
302
+ }
265
303
 
266
304
  sources = {};
267
305
  for (const [key, source] of entries(builtins.sources)) {
@@ -272,7 +310,7 @@ export function composeDatabase(options, builtins) {
272
310
  }
273
311
  for (const [key, source] of entries(options.sources)) sources[key] = source;
274
312
 
275
- // 6. Grades — from which grade on a technique is relevant.
313
+ // 7. Grades — from which grade on a technique or Poomsae is relevant.
276
314
  /** @type {Record<string, string[]>} */
277
315
  const grades = {};
278
316
  /** technique name → grade it is listed at */
@@ -292,11 +330,11 @@ export function composeDatabase(options, builtins) {
292
330
 
293
331
  for (const { grade, names } of listed) {
294
332
  for (const name of names) {
295
- if (!groupOf.has(name)) {
333
+ if (!groupOf.has(name) && !poomsae[name]) {
296
334
  throw new Error(
297
- builtinNames.has(name)
335
+ builtinNames.has(name) || builtinPoomsae[name]
298
336
  ? `grades: "${name}" (${grade.key}) is not included`
299
- : `grades: unknown technique "${name}" (${grade.key})`,
337
+ : `grades: unknown technique or Poomsae "${name}" (${grade.key})`,
300
338
  );
301
339
  }
302
340
  if (gradeOf.has(name)) {
@@ -309,5 +347,12 @@ export function composeDatabase(options, builtins) {
309
347
  grades[grade.key] = [...names];
310
348
  }
311
349
 
312
- return { customTechniques, grades, sources, techniqueGroups: groups, terms };
350
+ return {
351
+ customTechniques,
352
+ grades,
353
+ poomsae,
354
+ sources,
355
+ techniqueGroups: groups,
356
+ terms,
357
+ };
313
358
  }