From 904617f0ead1c59489cb9789647676be17d63c20 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 04:45:59 +0200 Subject: [PATCH 01/40] Create TeamListConversion.md --- TeamListConversion.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 TeamListConversion.md diff --git a/TeamListConversion.md b/TeamListConversion.md new file mode 100644 index 00000000000..6caa9c999e3 --- /dev/null +++ b/TeamListConversion.md @@ -0,0 +1,31 @@ +# Conversion of Template:TeamList + +## Affected Wikis +- stormgate: 8 pages +- starcraft2: ~600 pages +- starcraft: ~2k pages + +## Steps +- [x] Convert all Template:TeamList/Team calls to Template:TeamCard calls +- [x] Delete Template:TeamList/Team +- [ ] Convert all usages of pure TeamCard calls to use TeamList wrapper (TeamCard already uses TeamList under the hood) +- [ ] #6872 +- [ ] #7319 +- [ ] check if the sc(2) specific TC "roles" (captain, 2v2) work in TeamParticipants, if not see how to make them work +- [ ] check if combi of DNP & captain "role" work in TeamParticipants, if not see how to make it work +- [ ] Write a conversion wrapper (as dev of TeamList modules) +- [ ] Test conversion wrapper +- [ ] Inplace replace TeamList modules with the conversion wrapper +- [ ] Replace TeamCard and TeamList/Section usage with jsons (`subst:#json:`, TeamCard already does ecaxtly that, TeamList/Section only adds a single param) +- [ ] Delete Template:TeamCard on all 3 wikis & delete Template:TeamList/Section on commons +- [ ] If there are no issues mentioned within X months after inplace conversion start a (subst) replace run to use the option of the conversion wrapper to generate the wiki code +- [ ] Archive/Delete the TeamList modules (i.e. the conversion wrappers) + +## Conversion wrapper +- Basically mirror what TeamList modules do (import auto dnp etc pp) just without display +- Instead of display convert the collected data to new params and call TeamParticipants with them + - If section stuff is used each section has to call TeamParticipants stuff and then wrapp all the TeamParticipants calls into Tabs dynamic +- Add an **option** to generate wiki code instead of calling TeamParticipants + +## Param Mapping +to be defined From 21145d4c0c39b81267203f5956add1f115507e59 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 04:50:25 +0200 Subject: [PATCH 02/40] Update TeamListConversion.md --- TeamListConversion.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 6caa9c999e3..5db86d27a15 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -9,10 +9,11 @@ - [x] Convert all Template:TeamList/Team calls to Template:TeamCard calls - [x] Delete Template:TeamList/Team - [ ] Convert all usages of pure TeamCard calls to use TeamList wrapper (TeamCard already uses TeamList under the hood) -- [ ] #6872 -- [ ] #7319 -- [ ] check if the sc(2) specific TC "roles" (captain, 2v2) work in TeamParticipants, if not see how to make them work -- [ ] check if combi of DNP & captain "role" work in TeamParticipants, if not see how to make it work +- [ ] wait for necessary features of TeamParticipants + - [ ] #6872 + - [ ] #7319 + - [ ] check if the sc(2) specific TC "roles" (captain, 2v2) work in TeamParticipants, if not see how to make them work + - [ ] check if combi of DNP & captain "role" work in TeamParticipants, if not see how to make it work - [ ] Write a conversion wrapper (as dev of TeamList modules) - [ ] Test conversion wrapper - [ ] Inplace replace TeamList modules with the conversion wrapper @@ -24,7 +25,7 @@ ## Conversion wrapper - Basically mirror what TeamList modules do (import auto dnp etc pp) just without display - Instead of display convert the collected data to new params and call TeamParticipants with them - - If section stuff is used each section has to call TeamParticipants stuff and then wrapp all the TeamParticipants calls into Tabs dynamic + - If section stuff is used each section has to call TeamParticipants stuff and then wrap all the TeamParticipants calls into Tabs dynamic - Add an **option** to generate wiki code instead of calling TeamParticipants ## Param Mapping From 404092311457d75bd406b371f2e7da3bd7791304 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 04:53:24 +0200 Subject: [PATCH 03/40] Update TeamListConversion.md --- TeamListConversion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 5db86d27a15..1edfefd0d99 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -8,7 +8,7 @@ ## Steps - [x] Convert all Template:TeamList/Team calls to Template:TeamCard calls - [x] Delete Template:TeamList/Team -- [ ] Convert all usages of pure TeamCard calls to use TeamList wrapper (TeamCard already uses TeamList under the hood) +- [ ] Convert all usages of pure TeamCard calls (usually with box stuff arround them) to use TeamList wrapper (TeamCard already uses TeamList under the hood) - [ ] wait for necessary features of TeamParticipants - [ ] #6872 - [ ] #7319 From 3f8f74406e666a9180a50c9a1a745c609a835370 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 04:54:10 +0200 Subject: [PATCH 04/40] Update TeamListConversion.md --- TeamListConversion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 1edfefd0d99..bdae24d0131 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -17,7 +17,7 @@ - [ ] Write a conversion wrapper (as dev of TeamList modules) - [ ] Test conversion wrapper - [ ] Inplace replace TeamList modules with the conversion wrapper -- [ ] Replace TeamCard and TeamList/Section usage with jsons (`subst:#json:`, TeamCard already does ecaxtly that, TeamList/Section only adds a single param) +- [ ] Replace TeamCard and TeamList/Section usage with jsons (`subst:#json:`, TeamCard already does ecaxtly that when reaching this point, TeamList/Section only adds a single param) - [ ] Delete Template:TeamCard on all 3 wikis & delete Template:TeamList/Section on commons - [ ] If there are no issues mentioned within X months after inplace conversion start a (subst) replace run to use the option of the conversion wrapper to generate the wiki code - [ ] Archive/Delete the TeamList modules (i.e. the conversion wrappers) From 713e9aafe56e78842944ee414f3305018b3a9072 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 05:13:23 +0200 Subject: [PATCH 05/40] Update TeamListConversion.md --- TeamListConversion.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index bdae24d0131..95d62928b23 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -15,7 +15,7 @@ - [ ] check if the sc(2) specific TC "roles" (captain, 2v2) work in TeamParticipants, if not see how to make them work - [ ] check if combi of DNP & captain "role" work in TeamParticipants, if not see how to make it work - [ ] Write a conversion wrapper (as dev of TeamList modules) -- [ ] Test conversion wrapper +- [ ] Test conversion wrapper (incl perf test) - [ ] Inplace replace TeamList modules with the conversion wrapper - [ ] Replace TeamCard and TeamList/Section usage with jsons (`subst:#json:`, TeamCard already does ecaxtly that when reaching this point, TeamList/Section only adds a single param) - [ ] Delete Template:TeamCard on all 3 wikis & delete Template:TeamList/Section on commons @@ -23,8 +23,8 @@ - [ ] Archive/Delete the TeamList modules (i.e. the conversion wrappers) ## Conversion wrapper -- Basically mirror what TeamList modules do (import auto dnp etc pp) just without display -- Instead of display convert the collected data to new params and call TeamParticipants with them +- Basically mirror what TeamList modules do (import auto dnp etc pp) just without display and without storage +- Instead of display/storage convert the collected data to new params and call TeamParticipants with them - If section stuff is used each section has to call TeamParticipants stuff and then wrap all the TeamParticipants calls into Tabs dynamic - Add an **option** to generate wiki code instead of calling TeamParticipants From 87bcf5fb10cf3fffd3d6141dea39d82857cc461f Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 05:18:09 +0200 Subject: [PATCH 06/40] Update TeamListConversion.md --- TeamListConversion.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TeamListConversion.md b/TeamListConversion.md index 95d62928b23..c6cc0f53a74 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -9,6 +9,8 @@ - [x] Convert all Template:TeamList/Team calls to Template:TeamCard calls - [x] Delete Template:TeamList/Team - [ ] Convert all usages of pure TeamCard calls (usually with box stuff arround them) to use TeamList wrapper (TeamCard already uses TeamList under the hood) + - [x] bot job + - [ ] manual cleanup of the ones the bot did not catch (sc2 & sg done, sc: 70 pages) - [ ] wait for necessary features of TeamParticipants - [ ] #6872 - [ ] #7319 From 21eb08c216d0d36d7b29b338cf72f441cdf857c5 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 05:24:13 +0200 Subject: [PATCH 07/40] Update TeamListConversion.md --- TeamListConversion.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index c6cc0f53a74..0a3321d9ab6 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -10,7 +10,10 @@ - [x] Delete Template:TeamList/Team - [ ] Convert all usages of pure TeamCard calls (usually with box stuff arround them) to use TeamList wrapper (TeamCard already uses TeamList under the hood) - [x] bot job - - [ ] manual cleanup of the ones the bot did not catch (sc2 & sg done, sc: 70 pages) + - [ ] manual cleanup of the ones the bot did not catch + - [x] sc2 + - [x] sg + - [ ] bw: https://liquipedia.net/starcraft/Category:Pages_with_male_formatted_TeamList - [ ] wait for necessary features of TeamParticipants - [ ] #6872 - [ ] #7319 @@ -20,9 +23,19 @@ - [ ] Test conversion wrapper (incl perf test) - [ ] Inplace replace TeamList modules with the conversion wrapper - [ ] Replace TeamCard and TeamList/Section usage with jsons (`subst:#json:`, TeamCard already does ecaxtly that when reaching this point, TeamList/Section only adds a single param) + - [ ] sc2 + - [ ] sg + - [ ] bw - [ ] Delete Template:TeamCard on all 3 wikis & delete Template:TeamList/Section on commons + - [ ] sc2 + - [ ] sg + - [ ] bw + - [ ] commons - [ ] If there are no issues mentioned within X months after inplace conversion start a (subst) replace run to use the option of the conversion wrapper to generate the wiki code -- [ ] Archive/Delete the TeamList modules (i.e. the conversion wrappers) + - [ ] sc2 + - [ ] sg + - [ ] bw +- [ ] Archive/Delete the TeamList modules (i.e. the conversion wrappers) and Template:TeamList ## Conversion wrapper - Basically mirror what TeamList modules do (import auto dnp etc pp) just without display and without storage @@ -30,5 +43,5 @@ - If section stuff is used each section has to call TeamParticipants stuff and then wrap all the TeamParticipants calls into Tabs dynamic - Add an **option** to generate wiki code instead of calling TeamParticipants -## Param Mapping +### Param Mapping to be defined From e388d50549aed4d2177e4de46e74f7c15045393e Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 09:19:42 +0200 Subject: [PATCH 08/40] Update TeamListConversion.md --- TeamListConversion.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TeamListConversion.md b/TeamListConversion.md index 0a3321d9ab6..1411e8b6792 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -42,6 +42,7 @@ - Instead of display/storage convert the collected data to new params and call TeamParticipants with them - If section stuff is used each section has to call TeamParticipants stuff and then wrap all the TeamParticipants calls into Tabs dynamic - Add an **option** to generate wiki code instead of calling TeamParticipants +- Add a check that adds a cleanup category if it finds `'<%s*br%s*/?>'` in any of the inputs ### Param Mapping to be defined From 689c334aa849c8100bf4c312a67577b1d4e98649 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 10:11:12 +0200 Subject: [PATCH 09/40] Update TeamListConversion.md --- TeamListConversion.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TeamListConversion.md b/TeamListConversion.md index 1411e8b6792..0d1e21b4b9f 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -14,6 +14,10 @@ - [x] sc2 - [x] sg - [ ] bw: https://liquipedia.net/starcraft/Category:Pages_with_male_formatted_TeamList +- [ ] Clean up `Toggle group start`/`Toggle group end` usages in combi with TeamList + - [ ] sc2 + - [ ] sg + - [ ] bw - [ ] wait for necessary features of TeamParticipants - [ ] #6872 - [ ] #7319 From a3bf3780f1e2c79cf72290040291b1a398b1dc96 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 14:26:17 +0200 Subject: [PATCH 10/40] Update TeamListConversion.md --- TeamListConversion.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 0d1e21b4b9f..3d24d2951ac 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -23,6 +23,7 @@ - [ ] #7319 - [ ] check if the sc(2) specific TC "roles" (captain, 2v2) work in TeamParticipants, if not see how to make them work - [ ] check if combi of DNP & captain "role" work in TeamParticipants, if not see how to make it work + - [ ] check how player notes are handled and if this is doable ... - [ ] Write a conversion wrapper (as dev of TeamList modules) - [ ] Test conversion wrapper (incl perf test) - [ ] Inplace replace TeamList modules with the conversion wrapper @@ -49,4 +50,38 @@ - Add a check that adds a cleanup category if it finds `'<%s*br%s*/?>'` in any of the inputs ### Param Mapping -to be defined +#### new params +##### top level +- minimumplayers --> useless +- showplayerinfo --> useless +- mergeStaffTabIfOnlyOneStaff --> useless +- sortAlphabetically (#7319) --> legacy wrapper will do the sorting beforehand +- date +- store +- |X= --> Json of team data + +##### team level +- contenders --> useless +- qualification --> useless +- syncPlayerTeam --> false (legacy wrapper will do it beforehand) +- import --> always false (just fucks things up on these 3 wikis (plus warcraft) ...), better would be to forbid this entirely ... +- autoplayed --> false (legacy wrapper will do it beforehand) +- date +- aliases +- notes + - --> {{Json|note1|note2|note3}} + - --> note conversion has to be done manually as most of the notes are below the TeamLists and only a numebr is set in the TeamCards ... + - --> check how to handle the player notes ... +- players --> Json-Array of player level inputs + +##### player level +- trophies --> nil, unwanted +- number --> nil, unwanted +- type --> always `'player'`, we do not have nor want the staff shit at all ... +- played --> provided by wrapper info +- results --> nil (defaults to played input) +- role --> 'Captain'/'2v2'/nil +- status --> 'former'/'sub'/nil, unknown how to handle this atm + +### data available when mapping +todo - will be added at a later date (when i have the time to sift through the current module + check stuff with logging data) From 997fa95fb5b0a141d5243824816804150d392a1a Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 14:26:43 +0200 Subject: [PATCH 11/40] Update TeamListConversion.md --- TeamListConversion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 3d24d2951ac..3af264b77fd 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -65,7 +65,7 @@ - qualification --> useless - syncPlayerTeam --> false (legacy wrapper will do it beforehand) - import --> always false (just fucks things up on these 3 wikis (plus warcraft) ...), better would be to forbid this entirely ... -- autoplayed --> false (legacy wrapper will do it beforehand) +- autoplayed --> (#6872) false (legacy wrapper will do it beforehand) - date - aliases - notes From f798082e24bfcc27affcc36bc1e403ad0d853c8e Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 14:29:28 +0200 Subject: [PATCH 12/40] Update TeamListConversion.md --- TeamListConversion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 3af264b77fd..ab6010d0318 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -71,7 +71,7 @@ - notes - --> {{Json|note1|note2|note3}} - --> note conversion has to be done manually as most of the notes are below the TeamLists and only a numebr is set in the TeamCards ... - - --> check how to handle the player notes ... + - --> check how to handle the player notes (possibly a cluster fuck ...) ... - players --> Json-Array of player level inputs ##### player level From 756ca550f739184893d4e13d434e9f153ca163a7 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 14:33:52 +0200 Subject: [PATCH 13/40] Update TeamListConversion.md --- TeamListConversion.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TeamListConversion.md b/TeamListConversion.md index ab6010d0318..48868947c58 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -73,6 +73,7 @@ - --> note conversion has to be done manually as most of the notes are below the TeamLists and only a numebr is set in the TeamCards ... - --> check how to handle the player notes (possibly a cluster fuck ...) ... - players --> Json-Array of player level inputs +- template --> team template ##### player level - trophies --> nil, unwanted @@ -82,6 +83,11 @@ - results --> nil (defaults to played input) - role --> 'Captain'/'2v2'/nil - status --> 'former'/'sub'/nil, unknown how to handle this atm +- name +- flag +- faction +- link +- team --> if different from main team ... ### data available when mapping todo - will be added at a later date (when i have the time to sift through the current module + check stuff with logging data) From f7769f863aaefb6c05e6704d3e3d14d899992e87 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Sun, 10 May 2026 15:00:07 +0200 Subject: [PATCH 14/40] Update TeamListConversion.md --- TeamListConversion.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 48868947c58..37dc23681bb 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -15,9 +15,9 @@ - [x] sg - [ ] bw: https://liquipedia.net/starcraft/Category:Pages_with_male_formatted_TeamList - [ ] Clean up `Toggle group start`/`Toggle group end` usages in combi with TeamList - - [ ] sc2 + - [ ] sc2: https://liquipedia.net/starcraft2/User:Hjpalpha/wip17 - [ ] sg - - [ ] bw + - [ ] bw: https://liquipedia.net/starcraft2/User:Hjpalpha/wip17 - [ ] wait for necessary features of TeamParticipants - [ ] #6872 - [ ] #7319 From 08733b08140d4a9c558992e73795ae3a496dc80c Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 11 May 2026 08:21:15 +0200 Subject: [PATCH 15/40] Update TeamListConversion.md --- TeamListConversion.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 37dc23681bb..91557c91be4 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -8,12 +8,7 @@ ## Steps - [x] Convert all Template:TeamList/Team calls to Template:TeamCard calls - [x] Delete Template:TeamList/Team -- [ ] Convert all usages of pure TeamCard calls (usually with box stuff arround them) to use TeamList wrapper (TeamCard already uses TeamList under the hood) - - [x] bot job - - [ ] manual cleanup of the ones the bot did not catch - - [x] sc2 - - [x] sg - - [ ] bw: https://liquipedia.net/starcraft/Category:Pages_with_male_formatted_TeamList +- [x] Convert all usages of pure TeamCard calls (usually with box stuff arround them) to use TeamList wrapper (TeamCard already uses TeamList under the hood) - [ ] Clean up `Toggle group start`/`Toggle group end` usages in combi with TeamList - [ ] sc2: https://liquipedia.net/starcraft2/User:Hjpalpha/wip17 - [ ] sg From cc87a00d6a77da9405e2caf94bd8c5a0990c1ef4 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 11 May 2026 10:52:05 +0200 Subject: [PATCH 16/40] Update TeamListConversion.md --- TeamListConversion.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 91557c91be4..391390faed3 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -9,10 +9,7 @@ - [x] Convert all Template:TeamList/Team calls to Template:TeamCard calls - [x] Delete Template:TeamList/Team - [x] Convert all usages of pure TeamCard calls (usually with box stuff arround them) to use TeamList wrapper (TeamCard already uses TeamList under the hood) -- [ ] Clean up `Toggle group start`/`Toggle group end` usages in combi with TeamList - - [ ] sc2: https://liquipedia.net/starcraft2/User:Hjpalpha/wip17 - - [ ] sg - - [ ] bw: https://liquipedia.net/starcraft2/User:Hjpalpha/wip17 +- [x] Clean up `Toggle group start`/`Toggle group end` usages in combi with TeamList - [ ] wait for necessary features of TeamParticipants - [ ] #6872 - [ ] #7319 From ea12efcbf9b60acba7608cdf7021adf1e0e5c968 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 11 May 2026 10:53:37 +0200 Subject: [PATCH 17/40] Update TeamListConversion.md --- TeamListConversion.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 391390faed3..809925cf614 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -19,11 +19,11 @@ - [ ] Write a conversion wrapper (as dev of TeamList modules) - [ ] Test conversion wrapper (incl perf test) - [ ] Inplace replace TeamList modules with the conversion wrapper -- [ ] Replace TeamCard and TeamList/Section usage with jsons (`subst:#json:`, TeamCard already does ecaxtly that when reaching this point, TeamList/Section only adds a single param) +- [ ] Replace `TeamCard` and `TeamList/Section` usage with jsons (`subst:#json:`, TeamCard already does ecaxtly that when reaching this point, `TeamList/Section` only adds a single param) - [ ] sc2 - [ ] sg - [ ] bw -- [ ] Delete Template:TeamCard on all 3 wikis & delete Template:TeamList/Section on commons +- [ ] Delete Template:TeamCard on all 3 wikis & delete `Template:TeamList/Section` on commons - [ ] sc2 - [ ] sg - [ ] bw @@ -32,7 +32,11 @@ - [ ] sc2 - [ ] sg - [ ] bw -- [ ] Archive/Delete the TeamList modules (i.e. the conversion wrappers) and Template:TeamList +- [ ] Archive/Delete the TeamList modules (i.e. the conversion wrappers) and `Template:TeamList` + - [ ] commons + - [ ] sc2 + - [ ] sg + - [ ] bw ## Conversion wrapper - Basically mirror what TeamList modules do (import auto dnp etc pp) just without display and without storage From 6840c52d2aea7d0733395eb4e15e68932ddd671f Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 11 May 2026 22:10:24 +0200 Subject: [PATCH 18/40] start on barebones for the legacy wrapper --- lua/wikis/commons/TeamList/Starcraft.lua | 334 +++++++++++++++++++++++ 1 file changed, 334 insertions(+) create mode 100644 lua/wikis/commons/TeamList/Starcraft.lua diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua new file mode 100644 index 00000000000..ae9001e4301 --- /dev/null +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -0,0 +1,334 @@ +--- +-- for @Liquipedia by @hjpalpha +-- page=Module:TeamList/Starcraft +-- + +--[[ + +todo: +- sections marked with todo (especially mapping ...) +- debug +- double check if i missed some new args (i.e. compare to the md) + +]] + +local Arguments = require('Module:Arguments') +local Array = require('Module:Array') +local Class = require('Module:Class') +local Json = require('Module:Json') +local Logic = require('Module:Logic') +local Lua = require('Module:Lua') +local Table = require('Module:Table') + +local TeamCard = Lua.import('Module:TeamList/Starcraft/TeamCard') +local TournamentStructure = Lua.import('Module:TournamentStructure') + +local Opponent = Lua.import('Module:Opponent/Custom') + +local TeamParticipantsController = Lua.import('Module:TeamParticipants/Controller') +local Tabs = Lua.import('Module:Tabs') + +local TeamListWrapper = {} + +---@class StarcraftTeamList +---@operator call(table): StarcraftTeamList +---@field args table +---@field config StarcraftTeamListConfig +---@field sections StarcraftTeamListSection[] +---@field root Html? +local TeamList = Class.new( + function(self, args) + self.args = args + end +) + +---@param frame Frame +---@return Html? +function TeamListWrapper.TemplateTeamList(frame) + local args = Arguments.getArgs(frame) + local teamList = TeamList(args):read() + + mw.logObject(teamList) -- todo: remove once mapping works + + local newArgs = teamList:map() -- todo + teamList = nil + + mw.logObject(newArgs) -- todo: remove once mapping works + + if Logic.readBool(args.generate) then + TeamListWrapper.generate(newArgs) -- todo + end + + if not newArgs[2] then + return TeamParticipantsController.fromTemplate(newArgs[1]) + end + + local tabArgs = {} + Array.forEach(newArgs, function(tpArgs, index) + if not tpArgs.title then + -- todo: add tracking category + end + tabArgs['name' .. index] = tpArgs.title + tabArgs['content' .. index] = TeamParticipantsController.fromTemplate(tpArgs) + end) + + return Tabs.dynamic(tabArgs) +end + +---@param table[] +---@return string +function TeamListWrapper.generate(args) + if not args[2] then + return TeamListWrapper.generateSingle(args[1]) + end + + local parts = {'{{Tabs dynamic'} + Array.forEach(args, function(tpArgs, index) + table.insert(parts, '|name' .. index .. '=' .. tpArgs.title) + end) + table.insert(parts, '|This=1') + table.insert(parts, '}}') + + Array.forEach(args, function(tpArgs, index) + table.insert(parts, '{{Tabs dynamic/tab|' .. index .. '}}') + table.insert(parts, TeamListWrapper.generateSingle(tpArgs)) + end) + + table.insert(parts, '{{Tabs dynamic/end}}') + + return table.concat(parts, '\n') +end + +---@param table +---@return string +function TeamListWrapper.generateSingle(args) + local parts = { + '{{TeamParticipants', + TeamListWrapper.generateOuterConfig(args), --todo + } + + Array.forEach(args, function(oppArgs) + table.insert(parts, TeamListWrapper.generateOpponent(oppArgs)) + end) + table.insert(parts, '}}') + + return table.concat(parts, '\n') +end + +---@param table +---@return string? +function TeamListWrapper.generateOuterConfig(args) +--todo +end + + +---@param table +---@return string +function TeamListWrapper.generateOpponent(args) + local parts = { + '\n|{{Opponent|' .. args[1], + '\n\n|players={{Persons', + } + + Array.forEach(args.players, function(playerArgs) + table.insert(parts, TeamListWrapper.generatePlayer(playerArgs)) + end) + + table.insert(parts, '\t\t}}') + table.insert(parts, '\t}}') + + return table.concat(parts, '\n') +end + +---@param table +---@return string +function TeamListWrapper.generatePlayer(args) + local parts = { + '\t\t\t|{{Person|', + } + + -- todo (flag, role?, link?, faction, team?) + + table.insert(parts, '}}') + + return table.concat(parts) +end + +---@return self +function TeamList:read() + self.config = TeamList.readConfig(self.args) + self:readSections() + + return self +end + +---@return table[] +function TeamList.map() +-- todo +end + +---@class StarcraftTeamListConfig: StarcraftTeamCardConfig +---@field showCountBySection boolean +---@field count number? +---@field title string? +---@field sortTeams boolean +---@field playerInfoButton boolean +---@field matchGroupSpec {matchGroupIds: string[], pageNames: string[]}? +---@field import boolean +---@field importOnlyQualified boolean + +---@param args table +---@param parentConfig StarcraftTeamListConfig? +---@return StarcraftTeamListConfig +function TeamList.readConfig(args, parentConfig) + parentConfig = parentConfig or {} + + local matchGroupSpec = TournamentStructure.readMatchGroupsSpec(args) + local import = matchGroupSpec ~= nil + + local config = { + --display + showCountBySection = Logic.readBool(args.showCountBySection or parentConfig.showCountBySection), + count = tonumber(args.count), + title = args.title, + sortTeams = Logic.nilOr(Logic.readBoolOrNil(args.sortTeams), parentConfig.sortTeams, true), + playerInfoButton = Logic.readBool(args.playerInfoButton), + isAdhoc = Logic.nilOr(Logic.readBoolOrNil(args.adhoc), parentConfig.isAdhoc, false), + --import + matchGroupSpec = matchGroupSpec, + import = import, + importOnlyQualified = Logic.readBool(args.onlyQualified), + autoDnp = Logic.nilOr(Logic.readBoolOrNil(args.autoDnp), import or parentConfig.import or nil), + } + + return Table.merge(TeamCard.readConfig(args, parentConfig), config) +end + +function TeamList:readSections() + self.sections = {} + + local firstSection = Json.parseIfTable(self.args[1]) + if not firstSection then + return + elseif firstSection.type ~= 'section' then + --assume no sections and treat whole list as first section + table.insert(self.sections, self:readSection(self.args)) + return + end + + Array.forEach(self.args, function(potentialSection) + local sectionArgs = Json.parseIfTable(potentialSection) + assert(sectionArgs and sectionArgs.type == 'section', 'Invalid input: "' .. potentialSection .. '" is not a section') + table.insert(self.sections, self:readSection(sectionArgs)) + end) +end + +---@class StarcraftTeamListSection +---@field config StarcraftTeamListConfig +---@field title string? +---@field entries StarcraftTeamCard[] + +---@param sectionArgs table +---@return StarcraftTeamListSection +function TeamList:readSection(sectionArgs) + local section = {config = TeamList.readConfig(sectionArgs, self.config), title = sectionArgs.title} + local entriesByName = {} + + sectionArgs = Array.extractValues(Table.filterByKey(sectionArgs, function(key) return type(key) == 'number' end)) + + Array.forEach(sectionArgs, function(teamCardArgs) + local entry = TeamCard(Table.merge({date = section.config.resolveDate}, Json.parseIfTable(teamCardArgs))) + entriesByName[entry.name] = entry + end) + + section.entries = Array.map(self:import(section.config, entriesByName), function(entry) + return entry:getConfig(section.config):sync(self.config.matchGroupSpec) + end) + + return section +end + +---@param config StarcraftTeamListConfig +---@param entriesByName table +---@return StarcraftTeamCard[] +function TeamList:import(config, entriesByName) + if not config.import then + return Array.extractValues(entriesByName) + end + + local matchRecords = TeamList._fetchMatchRecords(config.matchGroupSpec) + if Table.isEmpty(matchRecords) then + return Array.extractValues(entriesByName) + end + ---@cast matchRecords -nil + return TeamList._entriesFromMatchRecords(matchRecords, config, entriesByName) +end + +---@param matchGroupSpec {matchGroupIds: string[], pageNames: string[]} +---@return table[] +function TeamList._fetchMatchRecords(matchGroupSpec) + return mw.ext.LiquipediaDB.lpdb('match2', { + conditions = tostring(TournamentStructure.getMatch2Filter(matchGroupSpec)), + query = 'pagename, match2bracketdata, match2opponents, winner', + order = 'date asc', + limit = 5000, + }) +end + +---@param matchRecords table[] +---@param config StarcraftTeamListConfig +---@param entriesByName table +---@return StarcraftTeamCard[] +function TeamList._entriesFromMatchRecords(matchRecords, config, entriesByName) + Array.forEach(matchRecords, function(matchRecord) + Array.forEach(matchRecord.match2opponents, function(opponentRecord, opponentIndex) + if not TeamList._shouldInclude(opponentIndex, matchRecord, config.importOnlyQualified) then + return + end + + if entriesByName[opponentRecord.name] then + return + end + + entriesByName[opponentRecord.name] = TeamList._entryFromOpponentRecord(opponentRecord, config.resolveDate) + end) + end) + + return Array.extractValues(entriesByName) +end + +---@param opponentIndex integer +---@param matchRecord table +---@param importOnlyQualified boolean? +---@return boolean +function TeamList._shouldInclude(opponentIndex, matchRecord, importOnlyQualified) + local bracketData = matchRecord.match2bracketdata + return not importOnlyQualified or Logic.readBool(bracketData.quallose) or + Logic.readBool(bracketData.qualwin) and tonumber(matchRecord.winner) == opponentIndex +end + +---@param opponentRecord table +---@param resolveDate string +---@return StarcraftTeamCard? +function TeamList._entryFromOpponentRecord(opponentRecord, resolveDate) + if opponentRecord.type ~= Opponent.team or not opponentRecord.template or opponentRecord.template:lower() == 'tbd' then + return + end + + local opponentArgs = { + team = opponentRecord.template, + date = resolveDate + } + + Array.forEach(opponentRecord.match2players, function(playerRecord, playerIndex) + local prefix = 'p' .. playerIndex + opponentArgs[prefix] = playerRecord.displayname + opponentArgs[prefix .. 'link'] = playerRecord.name + opponentArgs[prefix .. 'flag'] = playerRecord.flag + opponentArgs[prefix .. 'faction'] = (playerRecord.extradata or {}).faction + end) + + return TeamCard(opponentArgs) +end + +return TeamListWrapper From 901030d09c93ac26ce167aaab85f79632c7d305d Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 11 May 2026 22:11:18 +0200 Subject: [PATCH 19/40] some more --- .../commons/TeamList/Starcraft/TeamCard.lua | 302 ++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 lua/wikis/commons/TeamList/Starcraft/TeamCard.lua diff --git a/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua new file mode 100644 index 00000000000..b8aa5c7db72 --- /dev/null +++ b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua @@ -0,0 +1,302 @@ +--- +-- for @Liquipedia by @hjpalpha +-- page=Module:TeamList/Starcraft/TeamCard +-- + +local Lua = require('Module:Lua') + +local Array = Lua.import('Module:Array') +local Class = Lua.import('Module:Class') +local Faction = Lua.import('Module:Faction') +local Flags = Lua.import('Module:Flags') +local FnUtil = Lua.import('Module:FnUtil') +local Json = Lua.import('Module:Json') +local Logic = Lua.import('Module:Logic') +local Lpdb = Lua.import('Module:Lpdb') +local Namespace = Lua.import('Module:Namespace') +local String = Lua.import('Module:StringUtils') +local Table = Lua.import('Module:Table') +local TeamTemplate = Lua.import('Module:TeamTemplate') +local Variables = Lua.import('Module:Variables') + +local PlayerExt = Lua.import('Module:Player/Ext') +local PlayerExtCustom = Lua.import('Module:Player/Ext/Custom') +local TournamentStructure = Lua.import('Module:TournamentStructure') + +local Opponent = Lua.import('Module:Opponent/Custom') + +local getContextualDateOrNow = function() + local date = Variables.varDefault('tournament_enddate') + or Variables.varDefault('tournament_startdate') + + if Logic.isNotEmpty(date) then return date end + + local pageName = mw.title.getCurrentTitle().prefixedText:gsub(' ', '_') + + local data = mw.ext.LiquipediaDB.lpdb('tournament', { + conditions = '.[[pagename::' .. pageName .. ']]', + query = 'startdate, enddate', + limit = 1, + })[1] or {} + + return Logic.nilIfEmpty(data.enddate) + or Logic.nilIfEmpty(data.enddate) + or os.date('%F') +end + +---@class StarcraftTeamCard +---@operator call(table): StarcraftTeamCard +---@field args table +---@field config StarcraftTeamCardConfig +---@field opponent StarcraftTeamCardOpponent +---@field name string +---@field root Html? +local TeamCard = Class.new( + function(self, args) + self.args = args + self.opponent = self:readOpponent() + local opponentName = Opponent.toName(self.opponent) + assert(opponentName, 'Missing Team Template for "' .. (args.team or '') .. '"') + self.name = opponentName:gsub(' ', '_') + end +) + +---@class StarcraftTeamCardOpponent: StarcraftStandardOpponent +---@field players StarcraftTeamCardPlayer[] +---@field note string? +---@field dq boolean +---@field subtitle string? +---@field date string + +---@return StarcraftTeamCardOpponent +function TeamCard:readOpponent() + local args = self.args + local date = args.date or getContextualDateOrNow() + local team = (args.team or 'tbd'):lower():gsub('_', ' ') + local opponent = Opponent.resolve(Opponent.readOpponentArgs{team, type = Opponent.team}, date) + + opponent.dq = Logic.readBool(args.dq) + opponent.date = date + opponent.note = args.note + + opponent.players = Array.extractValues(Table.mapArgumentsByPrefix(args, {'p', 'player'}, function(key, index) + return self:readPlayer(key, index, date) + end)) + + if #opponent.players >= 35 then + mw.ext.TeamLiquidIntegration.add_category('TeamCards with 35 players') + elseif #opponent.players >= 25 then + mw.ext.TeamLiquidIntegration.add_category('TeamCards with 25 players') + elseif #opponent.players >= 20 then + mw.ext.TeamLiquidIntegration.add_category('TeamCards with 20 players') + end + + return opponent +end + +---@class StarcraftTeamCardPlayer: StarcraftStandardPlayer +---@field ace boolean? +---@field captain boolean? +---@field dnp boolean? +---@field dq boolean? +---@field joker boolean? +---@field mainTeam string? +---@field mainTeamPage string? +---@field note boolean? +---@field tag string? +---@field tagTitle string? +---@field two boolean? +---@field withdraw boolean? + +---@param key any +---@param index integer +---@param date string +---@return StarcraftTeamCardPlayer +function TeamCard:readPlayer(key, index, date) + local args = self.args + + local getArg = function(field) + return args['p' .. index .. field] or args[field .. index] + end + + local mainTeamInput = getArg('team') + if mainTeamInput and mainTeamInput:lower() == 'noteam' then + mainTeamInput = nil + end + + local mainTeam, mainTeamPage + if mainTeamInput then + mainTeam = TeamTemplate.resolve(mainTeamInput, date) + assert(mainTeam, 'missing team template "' .. mainTeamInput .. '"') + mainTeamPage = TeamTemplate.getPageName(mainTeam) or nil + end + + return { + displayName = args[key], + flag = String.nilIfEmpty(Flags.CountryName{flag = getArg('flag')}), + pageName = getArg('link'), + faction = Faction.read(getArg('faction') or getArg('race')), + + ace = Logic.readBoolOrNil(getArg('ace')), + captain = Logic.readBoolOrNil(getArg('captain')), + dnp = Logic.readBoolOrNil(getArg('dnp')), + dq = Logic.readBoolOrNil(getArg('dq') or getArg('out')), + joker = Logic.readBoolOrNil(getArg('joker')), + mainTeam = mainTeam, + mainTeamPage = mainTeamPage, + note = getArg('note'), + tag = getArg('tag'), + tagTitle = getArg('tagTitle'), + two = Logic.readBoolOrNil(getArg('two')), + withdraw = Logic.readBoolOrNil(getArg('withdraw')), + } +end + +---@class StarcraftTeamCardConfig +---@field cardWidth string +---@field teamStyle string? +---@field showFlags boolean +---@field display boolean +---@field collapsed boolean +---@field collapsible boolean? +---@field autoDnp boolean +---@field syncPlayers boolean +---@field resolveDate string +---@field sortPlayers boolean +---@field noStorage boolean +---@field isAdhoc boolean? + +---@param parentConfig StarcraftTeamListConfig? +---@return self +function TeamCard:getConfig(parentConfig) + self.config = TeamCard.readConfig(self.args, parentConfig) + + return self +end + +---@param args table +---@param parentConfig StarcraftTeamListConfig? +---@return StarcraftTeamListConfig +function TeamCard.readConfig(args, parentConfig) + parentConfig = parentConfig or {} + + local width = tonumber(args.cardWidth or args.width) + + return { + --display + cardWidth = width and (width .. 'px') or args.cardWidth or args.width or parentConfig.cardWidth or '240px', + teamStyle = Logic.readBool(args.short) and 'short' or parentConfig.teamStyle, + showFlags = Logic.nilOr(Logic.readBoolOrNil(args.showFlags), parentConfig.showFlags, true), + display = not Logic.readBool(args.hidden), + collapsed =Logic.nilOr(Logic.readBoolOrNil(args.collapsed), not Logic.readBoolOrNil(args.uncollapsed)), + collapsible = Logic.nilOr(Logic.readBoolOrNil(args.collapsible), parentConfig.collapsible, true), + --sync + autoDnp = Logic.nilOr(Logic.readBoolOrNil(args.autoDnp), parentConfig.autoDnp, true), + syncPlayers = Logic.nilOr(Logic.readBoolOrNil(args.syncPlayers), parentConfig.syncPlayers, true), + resolveDate = args.date or parentConfig.resolveDate or getContextualDateOrNow(), + sortPlayers = Logic.nilOr(Logic.readBoolOrNil(args.sortPlayers), parentConfig.sortPlayers, true), + --storage + noStorage = Logic.readBool(args.noStorage or parentConfig.noStorage or + Lpdb.isStorageDisabled() or not Namespace.isMain()), + isAdhoc = Logic.nilOr(Logic.readBoolOrNil(args.adhoc), parentConfig.isAdhoc), + } +end + +---@param parentMatchGroupSpec {matchGroupIds: string[], pageNames: string[]}? +---@return self +function TeamCard:sync(parentMatchGroupSpec) + local config = self.config + + local players = self.opponent.players + + if Table.isEmpty(players) then + return self + end + + local date = self.opponent.date + + if config.syncPlayers then + players = Array.map(players, function(player) + player = Table.merge(player, PlayerExtCustom.syncPlayer(player, {date = date})) + player.pageName = player.pageName:gsub(' ', '_') + player.mainTeam = config.isAdhoc and PlayerExt.syncTeam(player.pageName, player.mainTeam) or player.mainTeam + player.mainTeamPage = player.mainTeamPage or + player.mainTeam and TeamTemplate.getPageName(TeamTemplate.resolve(player.mainTeam, date)) or + nil + + return player + end) + end + + if config.autoDnp then + local matchGroupSpec = parentMatchGroupSpec or TournamentStructure.currentPageSpec() + players = self:dnp(players, matchGroupSpec) + end + + if config.sortPlayers then + Array.sortInPlaceBy(players, function(player) return player.displayName:lower() end) + end + + self.opponent.players = players + + return self +end + +---@param players StarcraftTeamCardPlayer[] +---@param matchGroupSpec {matchGroupIds: string[], pageNames: string[]} +---@return StarcraftTeamCardPlayer[] +function TeamCard:dnp(players, matchGroupSpec) + local dnpData = TeamCard.fetchDnp(matchGroupSpec) + + Array.map(players, function(player) + player.dnp = player.dnp or (dnpData[self.name] and not dnpData[self.name][player.pageName]) + + return player + end) + + return players +end + +TeamCard.fetchDnp = FnUtil.memoize(function(matchGroupSpec) + return TeamCard.fetchDnpData(matchGroupSpec) +end) + +---@param matchGroupSpec {matchGroupIds: string[], pageNames: string[]} +---@return table> +function TeamCard.fetchDnpData(matchGroupSpec) + local matchRecords = mw.ext.LiquipediaDB.lpdb('match2', { + conditions = tostring(TournamentStructure.getMatch2Filter(matchGroupSpec)), + query = 'pagename, match2bracketdata, match2opponents, winner, match2games', + order = 'date asc', + limit = 5000, + }) + + local playersByTeam = {} + Array.forEach(matchRecords, function(matchRecord) + local teams = Array.map(matchRecord.match2opponents, function(opponent, opponentIndex) + playersByTeam[opponent.name] = playersByTeam[opponent.name] or {} + return {name = opponent.name, players = Array.map(opponent.match2players, function(player) return player.name end)} + end) + + Array.forEach(matchRecord.match2games, function(game) + local gameOpponents = game.opponents + if type(gameOpponents) ~= 'table' then + gameOpponents = Json.parseIfTable(gameOpponents) or {} + end + Array.forEach(gameOpponents, function(opp, opponentIndex) + for playerIndex, player in pairs(opp.players or {}) do + if Logic.isNotEmpty(player) then + local matchPlayer = teams[opponentIndex].players[playerIndex] + if player then + playersByTeam[teams[opponentIndex].name][matchPlayer] = true + end + end + end + end) + end) + end) + + return playersByTeam +end + +return TeamCard From ce3530e9e65f36b21ae6b88bf5746210af7ca64e Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 11 May 2026 22:20:03 +0200 Subject: [PATCH 20/40] Update TeamCard.lua --- lua/wikis/commons/TeamList/Starcraft/TeamCard.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua index b8aa5c7db72..17e57949869 100644 --- a/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua +++ b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua @@ -25,6 +25,8 @@ local TournamentStructure = Lua.import('Module:TournamentStructure') local Opponent = Lua.import('Module:Opponent/Custom') +-- can't use the DateExt function +-- due to the wiki vars not existing if using subst bot run local getContextualDateOrNow = function() local date = Variables.varDefault('tournament_enddate') or Variables.varDefault('tournament_startdate') From 2b849d76d7293919acfc79a3e18e573f8dc2b97e Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 11 May 2026 22:21:01 +0200 Subject: [PATCH 21/40] Update TeamCard.lua --- lua/wikis/commons/TeamList/Starcraft/TeamCard.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua index 17e57949869..89996eb0153 100644 --- a/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua +++ b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua @@ -42,7 +42,7 @@ local getContextualDateOrNow = function() })[1] or {} return Logic.nilIfEmpty(data.enddate) - or Logic.nilIfEmpty(data.enddate) + or Logic.nilIfEmpty(data.startdate) or os.date('%F') end From 38b3142d33e1c825afa25e70561d5167fe30a60c Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Tue, 12 May 2026 06:17:19 +0200 Subject: [PATCH 22/40] Update Starcraft.lua --- lua/wikis/commons/TeamList/Starcraft.lua | 67 ++++++++++++++++++++---- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index ae9001e4301..9a7cf8dd16c 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -8,7 +8,6 @@ todo: - sections marked with todo (especially mapping ...) - debug -- double check if i missed some new args (i.e. compare to the md) ]] @@ -56,7 +55,15 @@ function TeamListWrapper.TemplateTeamList(frame) mw.logObject(newArgs) -- todo: remove once mapping works if Logic.readBool(args.generate) then - TeamListWrapper.generate(newArgs) -- todo + TeamListWrapper.generate(newArgs) + end + + if Array.any(newArgs, function(section) + return Array.any(section, function(opp) + return Logic.isNotEmpty(opp.notes) + end) + end) then + mw.ext.TeamLiquidIntegration.add_category('TeamList with notes') end if not newArgs[2] then @@ -66,7 +73,7 @@ function TeamListWrapper.TemplateTeamList(frame) local tabArgs = {} Array.forEach(newArgs, function(tpArgs, index) if not tpArgs.title then - -- todo: add tracking category + mw.ext.TeamLiquidIntegration.add_category('TeamList with missing section title') end tabArgs['name' .. index] = tpArgs.title tabArgs['content' .. index] = TeamParticipantsController.fromTemplate(tpArgs) @@ -104,7 +111,7 @@ end function TeamListWrapper.generateSingle(args) local parts = { '{{TeamParticipants', - TeamListWrapper.generateOuterConfig(args), --todo + TeamListWrapper.generateOuterConfig(args), } Array.forEach(args, function(oppArgs) @@ -118,7 +125,21 @@ end ---@param table ---@return string? function TeamListWrapper.generateOuterConfig(args) ---todo + local params = { + 'showplayerinfo', + 'date', + } + + local parts = Array.map(params, function(param) + local value = args[param] + if Logic.isEmpty(value) then return end + return '|' .. param .. '=' .. value + end) + + local store = args.store == false and 'false' or 'false' -- todo: double check if includeonly or onlyinclude ... + table.insert(parts, '|store=' .. store) + + return table.concat(parts) end @@ -126,15 +147,25 @@ end ---@return string function TeamListWrapper.generateOpponent(args) local parts = { - '\n|{{Opponent|' .. args[1], - '\n\n|players={{Persons', + '\t|{{Opponent|' .. args.template, + '\t\t|import=false', + Logic.isNotEmpty(args.date) and ('\t\t|date=' .. args.date) or nil, } + table.insert(parts, '\t\t|players={{Persons') Array.forEach(args.players, function(playerArgs) table.insert(parts, TeamListWrapper.generatePlayer(playerArgs)) end) - table.insert(parts, '\t\t}}') + + if Logic.isNotEmpty(args.notes) then + table.insert(parts, '\t\t|notes={{Json') + Array.forEach(notes, function(note) + table.insert(parts, '\t\t\t|' .. note) + end) + table.insert(parts, '\t\t}}') + end + table.insert(parts, '\t}}') return table.concat(parts, '\n') @@ -144,10 +175,26 @@ end ---@return string function TeamListWrapper.generatePlayer(args) local parts = { - '\t\t\t|{{Person|', + '\t\t\t|{{Person|' .. args.name, } - -- todo (flag, role?, link?, faction, team?) + local add = function(param) + local value = args[param] + if Logic.isEmpty(value) then return end + table.insert(parts, '|' .. param .. '=' .. value) + end + + local params = { + 'link', + 'flag', + 'faction', + 'team', + 'role', + 'played', + 'results', + 'status', + } + Array.forEach(params, add) table.insert(parts, '}}') From 1bc1121d938f86feab32b2e6b55e82a4cfd0d137 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 07:58:45 +0200 Subject: [PATCH 23/40] some window dressing --- lua/wikis/commons/TeamList/Starcraft.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index 9a7cf8dd16c..831c41a7b8a 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -7,6 +7,7 @@ todo: - sections marked with todo (especially mapping ...) +- Add a check that adds a cleanup category if it finds `'<%s*br%s*/?>'` in any of the inputs - debug ]] @@ -42,7 +43,7 @@ local TeamList = Class.new( ) ---@param frame Frame ----@return Html? +---@return Renderable? function TeamListWrapper.TemplateTeamList(frame) local args = Arguments.getArgs(frame) local teamList = TeamList(args):read() @@ -50,6 +51,8 @@ function TeamListWrapper.TemplateTeamList(frame) mw.logObject(teamList) -- todo: remove once mapping works local newArgs = teamList:map() -- todo + -- throw the class away to not clog up memory + ---@diagnostic disable-next-line: cast-local-type teamList = nil mw.logObject(newArgs) -- todo: remove once mapping works @@ -82,7 +85,7 @@ function TeamListWrapper.TemplateTeamList(frame) return Tabs.dynamic(tabArgs) end ----@param table[] +---@param args table[] ---@return string function TeamListWrapper.generate(args) if not args[2] then @@ -106,7 +109,7 @@ function TeamListWrapper.generate(args) return table.concat(parts, '\n') end ----@param table +---@param args table ---@return string function TeamListWrapper.generateSingle(args) local parts = { @@ -122,7 +125,7 @@ function TeamListWrapper.generateSingle(args) return table.concat(parts, '\n') end ----@param table +---@param args table ---@return string? function TeamListWrapper.generateOuterConfig(args) local params = { @@ -143,7 +146,7 @@ function TeamListWrapper.generateOuterConfig(args) end ----@param table +---@param args table ---@return string function TeamListWrapper.generateOpponent(args) local parts = { @@ -160,7 +163,7 @@ function TeamListWrapper.generateOpponent(args) if Logic.isNotEmpty(args.notes) then table.insert(parts, '\t\t|notes={{Json') - Array.forEach(notes, function(note) + Array.forEach(args.notes, function(note) table.insert(parts, '\t\t\t|' .. note) end) table.insert(parts, '\t\t}}') @@ -171,7 +174,7 @@ function TeamListWrapper.generateOpponent(args) return table.concat(parts, '\n') end ----@param table +---@param args table ---@return string function TeamListWrapper.generatePlayer(args) local parts = { @@ -282,7 +285,7 @@ function TeamList:readSection(sectionArgs) local entriesByName = {} sectionArgs = Array.extractValues(Table.filterByKey(sectionArgs, function(key) return type(key) == 'number' end)) - + Array.forEach(sectionArgs, function(teamCardArgs) local entry = TeamCard(Table.merge({date = section.config.resolveDate}, Json.parseIfTable(teamCardArgs))) entriesByName[entry.name] = entry From 0e2049f88939bd18fd3cba87e8a447a5a4b9eda3 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 07:58:59 +0200 Subject: [PATCH 24/40] old params and their mapping to new ones --- TeamListConversion.md | 147 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 145 insertions(+), 2 deletions(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 809925cf614..204f3343462 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -49,9 +49,9 @@ #### new params ##### top level - minimumplayers --> useless -- showplayerinfo --> useless - mergeStaffTabIfOnlyOneStaff --> useless - sortAlphabetically (#7319) --> legacy wrapper will do the sorting beforehand +- showplayerinfo - date - store - |X= --> Json of team data @@ -86,4 +86,147 @@ - team --> if different from main team ... ### data available when mapping -todo - will be added at a later date (when i have the time to sift through the current module + check stuff with logging data) +#### top level +- secitions: section[] +- config: + - drop in mapping (read from section level instead) + +#### section level +- title: string? + -> section.title +- entries TC[] + -> section.X +- config: + - showCountBySection: bool + -> adjust title in mapping + - count: number? + -> adjust title in mapping + - title: string? + -> section.title + - sortTeams: bool + -> if sorting already done before drop, else sort and drop + - playerInfoButton: bool + -> section.showplayerinfo + - matchGroupSpec: {matchGroupIds: string[], pageNames: string[]}? + -> drop + - import: bool + -> drop + - importOnlyQualified: bool + -> drop + - cardWidth: string + -> drop + - teamStyle: string? + -> drop + - showFlags: bool + -> drop + - display: bool + -> drop + - collapsed: bool + -> drop + - collapsible: bool + -> drop + - autoDnp: bool + -> drop + - syncPlayers: bool + -> drop + - resolveDate: string + -> section.date + - sortPlayers: bool + -> drop + - noStorage: bool + -> section.store (invert if not empty ...) + -> check if we have to adjust the base processing to get nil if unset here + - isAdhoc: bool + -> drop + +#### TC level +- name: string + -> drop +- opponent: StarcraftTeamCardOpponent + - players: player[] + -> map into .players + - note: string? + -> into .notes + - dq: bool + -> ??? (tracking category!) + - subtitle: string? + -> drop + - date: string + -> .date + - template: string + -> .template + -rest + -> drop +- config + - showCountBySection: bool + -> drop + - count: number? + -> drop + - title: string? + -> drop + - sortTeams: bool + -> drop + - playerInfoButton: bool + -> drop + - matchGroupSpec: {matchGroupIds: string[], pageNames: string[]}? + -> drop + - import: bool + -> drop + - importOnlyQualified: bool + -> drop + - cardWidth: string + -> drop + - teamStyle: string? + -> drop + - showFlags: bool + -> drop + - display: bool + -> drop + - collapsed: bool + -> drop + - collapsible: bool + -> drop + - autoDnp: bool + -> drop + - syncPlayers: bool + -> drop + - resolveDate: string + -> .date + - sortPlayers: bool + -> if sorting already done before drop, else sort and drop + - noStorage: bool + -> drop + - isAdhoc: bool + -> check if teams are already determind, if not do it + -> drop + +#### player level +- ace: boolean? + -> drop +- captain: boolean? +- dnp: boolean? +- dq: boolean? +- joker: boolean? + -> drop +- mainTeam: string? + -> drop +- mainTeamPage: string? + -> .team == mainTeamPage ~= TC.name and mainTeamPage or nil +- note: boolean? + -> into TC notes +- tag: string? + -> drop +- tagTitle: string? + -> drop +- two: boolean? + -> ??? (role?) +- withdraw: boolean? + -> ??? (|played=true|result=false???) +- displayName: string? + -> .name +- flag: string? + -> .flag +- pageName: string? + -> .link +- faction: string? + -> .faction From 0a181460b9aef78a220d02a47b937d417731dde0 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 08:01:13 +0200 Subject: [PATCH 25/40] another tracking category --- lua/wikis/commons/TeamList/Starcraft.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index 831c41a7b8a..a13fc3e54db 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -7,7 +7,6 @@ todo: - sections marked with todo (especially mapping ...) -- Add a check that adds a cleanup category if it finds `'<%s*br%s*/?>'` in any of the inputs - debug ]] @@ -46,6 +45,13 @@ local TeamList = Class.new( ---@return Renderable? function TeamListWrapper.TemplateTeamList(frame) local args = Arguments.getArgs(frame) + + for _, item in pairs(args) do + if item:find('<%s*br%s*/?>') then + mw.ext.TeamLiquidIntegration.add_category('TeamList with br') + end + end + local teamList = TeamList(args):read() mw.logObject(teamList) -- todo: remove once mapping works From 50341c5547a527efb2bb38754a64e471379744ea Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 09:27:25 +0200 Subject: [PATCH 26/40] stfu warnings --- lua/wikis/commons/TeamList/Starcraft/TeamCard.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua index 89996eb0153..e8ccb51c9be 100644 --- a/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua +++ b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua @@ -43,7 +43,7 @@ local getContextualDateOrNow = function() return Logic.nilIfEmpty(data.enddate) or Logic.nilIfEmpty(data.startdate) - or os.date('%F') + or os.date('%F') --[[@as string]] end ---@class StarcraftTeamCard @@ -75,7 +75,7 @@ function TeamCard:readOpponent() local args = self.args local date = args.date or getContextualDateOrNow() local team = (args.team or 'tbd'):lower():gsub('_', ' ') - local opponent = Opponent.resolve(Opponent.readOpponentArgs{team, type = Opponent.team}, date) + local opponent = Opponent.resolve(Opponent.readOpponentArgs{team, type = Opponent.team}, date) --[[@as StarcraftTeamCardOpponent]] opponent.dq = Logic.readBool(args.dq) opponent.date = date @@ -221,9 +221,9 @@ function TeamCard:sync(parentMatchGroupSpec) players = Array.map(players, function(player) player = Table.merge(player, PlayerExtCustom.syncPlayer(player, {date = date})) player.pageName = player.pageName:gsub(' ', '_') - player.mainTeam = config.isAdhoc and PlayerExt.syncTeam(player.pageName, player.mainTeam) or player.mainTeam + player.mainTeam = config.isAdhoc and PlayerExt.syncTeam(player.pageName, player.mainTeam, {}) or player.mainTeam player.mainTeamPage = player.mainTeamPage or - player.mainTeam and TeamTemplate.getPageName(TeamTemplate.resolve(player.mainTeam, date)) or + player.mainTeam and TeamTemplate.getPageName(TeamTemplate.resolve(player.mainTeam, date) --[[@as string]]) or nil return player @@ -250,10 +250,8 @@ end function TeamCard:dnp(players, matchGroupSpec) local dnpData = TeamCard.fetchDnp(matchGroupSpec) - Array.map(players, function(player) + Array.forEach(players, function(player) player.dnp = player.dnp or (dnpData[self.name] and not dnpData[self.name][player.pageName]) - - return player end) return players From 9261e8bdad345ef2f2ec29d9301e9e511baccee4 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 09:27:44 +0200 Subject: [PATCH 27/40] start on the mapping --- lua/wikis/commons/TeamList/Starcraft.lua | 51 +++++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index a13fc3e54db..04e26c674e5 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -219,8 +219,55 @@ function TeamList:read() end ---@return table[] -function TeamList.map() --- todo +function TeamList:map() + return Array.map(self.sections, function(section) + local config = section.config + + local args = { + title = section.title or config.title, + showplayerinfo = config.playerInfoButton, + date = config.resolveDate, + store = not config.noStorage, + } + + if args.title and config.showCountBySection then + args.title = args.title .. ' (' .. (config.count or #section.entries) .. ')' + end + + if config.sortTeams then + Array.sortInPlaceBy(section.entries, function(entry) return entry.name:lower() end) + end + + Table.mergeInto(args, Array.map(section.entries, TeamList.mapEntry)) + end) +end + +---@param entry StarcraftTeamCard +---@return table +function TeamList.mapEntry(entry) + local opp = entry.opponent + local notes = {opp.note} + local args = { + players = Array.map(opp.players, function(player) + table.insert(notes, player.note) + return TeamList.mapPlayer(player) + end), + template = opp.template, + date = opp.date, + } + args.notes = notes + + if opp.dq then + mw.ext.TeamLiquidIntegration.add_category('TeamList with dq') + end + + return args +end + +---@param player any +---@return table +function TeamList.mapPlayer(player) + end ---@class StarcraftTeamListConfig: StarcraftTeamCardConfig From aa2f8b79e3bd877ae0469f2db252703e0df3e835 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 09:39:01 +0200 Subject: [PATCH 28/40] rest of mapping (i hope) --- lua/wikis/commons/TeamList/Starcraft.lua | 26 ++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index 04e26c674e5..a251ebf6d77 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -258,16 +258,38 @@ function TeamList.mapEntry(entry) args.notes = notes if opp.dq then - mw.ext.TeamLiquidIntegration.add_category('TeamList with dq') + mw.ext.TeamLiquidIntegration.add_category('TeamList with dq opponent') end return args end ----@param player any +---@param player StarcraftTeamCardPlayer ---@return table function TeamList.mapPlayer(player) + local args = { + name = player.displayName or player.pageName, + link = player.pageName, + flag = player.flag, + faction = player.faction, + team = player.mainTeamPage, + } + + if player.dnp then + args.played = 'false' + end + local role = player.captain and 'Captain' + or player['2v2'] and '2v2' + or nil + + if player.dq then + args.status = 'former' + args.result = 'false' + elseif player.withdraw then + args.status = 'former' + end + return args end ---@class StarcraftTeamListConfig: StarcraftTeamCardConfig From f1d91a0c172262d41020576a639004b20bac6b2c Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 09:39:17 +0200 Subject: [PATCH 29/40] remove mapping stuff from md as it is in the modules now --- TeamListConversion.md | 186 ------------------------------------------ 1 file changed, 186 deletions(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index 204f3343462..f2c2ede017b 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -44,189 +44,3 @@ - If section stuff is used each section has to call TeamParticipants stuff and then wrap all the TeamParticipants calls into Tabs dynamic - Add an **option** to generate wiki code instead of calling TeamParticipants - Add a check that adds a cleanup category if it finds `'<%s*br%s*/?>'` in any of the inputs - -### Param Mapping -#### new params -##### top level -- minimumplayers --> useless -- mergeStaffTabIfOnlyOneStaff --> useless -- sortAlphabetically (#7319) --> legacy wrapper will do the sorting beforehand -- showplayerinfo -- date -- store -- |X= --> Json of team data - -##### team level -- contenders --> useless -- qualification --> useless -- syncPlayerTeam --> false (legacy wrapper will do it beforehand) -- import --> always false (just fucks things up on these 3 wikis (plus warcraft) ...), better would be to forbid this entirely ... -- autoplayed --> (#6872) false (legacy wrapper will do it beforehand) -- date -- aliases -- notes - - --> {{Json|note1|note2|note3}} - - --> note conversion has to be done manually as most of the notes are below the TeamLists and only a numebr is set in the TeamCards ... - - --> check how to handle the player notes (possibly a cluster fuck ...) ... -- players --> Json-Array of player level inputs -- template --> team template - -##### player level -- trophies --> nil, unwanted -- number --> nil, unwanted -- type --> always `'player'`, we do not have nor want the staff shit at all ... -- played --> provided by wrapper info -- results --> nil (defaults to played input) -- role --> 'Captain'/'2v2'/nil -- status --> 'former'/'sub'/nil, unknown how to handle this atm -- name -- flag -- faction -- link -- team --> if different from main team ... - -### data available when mapping -#### top level -- secitions: section[] -- config: - - drop in mapping (read from section level instead) - -#### section level -- title: string? - -> section.title -- entries TC[] - -> section.X -- config: - - showCountBySection: bool - -> adjust title in mapping - - count: number? - -> adjust title in mapping - - title: string? - -> section.title - - sortTeams: bool - -> if sorting already done before drop, else sort and drop - - playerInfoButton: bool - -> section.showplayerinfo - - matchGroupSpec: {matchGroupIds: string[], pageNames: string[]}? - -> drop - - import: bool - -> drop - - importOnlyQualified: bool - -> drop - - cardWidth: string - -> drop - - teamStyle: string? - -> drop - - showFlags: bool - -> drop - - display: bool - -> drop - - collapsed: bool - -> drop - - collapsible: bool - -> drop - - autoDnp: bool - -> drop - - syncPlayers: bool - -> drop - - resolveDate: string - -> section.date - - sortPlayers: bool - -> drop - - noStorage: bool - -> section.store (invert if not empty ...) - -> check if we have to adjust the base processing to get nil if unset here - - isAdhoc: bool - -> drop - -#### TC level -- name: string - -> drop -- opponent: StarcraftTeamCardOpponent - - players: player[] - -> map into .players - - note: string? - -> into .notes - - dq: bool - -> ??? (tracking category!) - - subtitle: string? - -> drop - - date: string - -> .date - - template: string - -> .template - -rest - -> drop -- config - - showCountBySection: bool - -> drop - - count: number? - -> drop - - title: string? - -> drop - - sortTeams: bool - -> drop - - playerInfoButton: bool - -> drop - - matchGroupSpec: {matchGroupIds: string[], pageNames: string[]}? - -> drop - - import: bool - -> drop - - importOnlyQualified: bool - -> drop - - cardWidth: string - -> drop - - teamStyle: string? - -> drop - - showFlags: bool - -> drop - - display: bool - -> drop - - collapsed: bool - -> drop - - collapsible: bool - -> drop - - autoDnp: bool - -> drop - - syncPlayers: bool - -> drop - - resolveDate: string - -> .date - - sortPlayers: bool - -> if sorting already done before drop, else sort and drop - - noStorage: bool - -> drop - - isAdhoc: bool - -> check if teams are already determind, if not do it - -> drop - -#### player level -- ace: boolean? - -> drop -- captain: boolean? -- dnp: boolean? -- dq: boolean? -- joker: boolean? - -> drop -- mainTeam: string? - -> drop -- mainTeamPage: string? - -> .team == mainTeamPage ~= TC.name and mainTeamPage or nil -- note: boolean? - -> into TC notes -- tag: string? - -> drop -- tagTitle: string? - -> drop -- two: boolean? - -> ??? (role?) -- withdraw: boolean? - -> ??? (|played=true|result=false???) -- displayName: string? - -> .name -- flag: string? - -> .flag -- pageName: string? - -> .link -- faction: string? - -> .faction From 321f3c8ae8c324b8fa92d430958cf9831c650b80 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 09:49:28 +0200 Subject: [PATCH 30/40] lets kick this --- lua/wikis/commons/TeamList/Starcraft.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index a251ebf6d77..5129f34780f 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -278,9 +278,7 @@ function TeamList.mapPlayer(player) if player.dnp then args.played = 'false' end - local role = player.captain and 'Captain' - or player['2v2'] and '2v2' - or nil + local role = player.captain and 'Captain' or nil if player.dq then args.status = 'former' From 93f2fd8aafbe2e0b5b30e89601f8f87a05a1042e Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 09:49:50 +0200 Subject: [PATCH 31/40] update the steps in the md --- TeamListConversion.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/TeamListConversion.md b/TeamListConversion.md index f2c2ede017b..46cb1e59fba 100644 --- a/TeamListConversion.md +++ b/TeamListConversion.md @@ -10,20 +10,23 @@ - [x] Delete Template:TeamList/Team - [x] Convert all usages of pure TeamCard calls (usually with box stuff arround them) to use TeamList wrapper (TeamCard already uses TeamList under the hood) - [x] Clean up `Toggle group start`/`Toggle group end` usages in combi with TeamList -- [ ] wait for necessary features of TeamParticipants - - [ ] #6872 - - [ ] #7319 +- [ ] Write conversion wrapper (as dev of `TeamList` modules) + - [x] initial + - [ ] test & debug + - [ ] perf test +- [ ] wait for necessary features of TeamParticipants for using wrapper - [ ] check if the sc(2) specific TC "roles" (captain, 2v2) work in TeamParticipants, if not see how to make them work - [ ] check if combi of DNP & captain "role" work in TeamParticipants, if not see how to make it work - - [ ] check how player notes are handled and if this is doable ... -- [ ] Write a conversion wrapper (as dev of TeamList modules) -- [ ] Test conversion wrapper (incl perf test) - [ ] Inplace replace TeamList modules with the conversion wrapper -- [ ] Replace `TeamCard` and `TeamList/Section` usage with jsons (`subst:#json:`, TeamCard already does ecaxtly that when reaching this point, `TeamList/Section` only adds a single param) +- [ ] wait for necessary features of TeamParticipants + - [ ] #6872 + - [ ] #7319 +- [ ] start using TeamParticipants on new pages +- [ ] Replace `TeamCard` and `TeamList/Section` usage with jsons (`subst:#json:`, TeamCard already does ecaxtly that when reaching this point, `TeamList/Section` only adds a single param (`|type=section`)) - [ ] sc2 - [ ] sg - [ ] bw -- [ ] Delete Template:TeamCard on all 3 wikis & delete `Template:TeamList/Section` on commons +- [ ] Delete `Template:TeamCard` on all 3 wikis & delete `Template:TeamList/Section` on commons - [ ] sc2 - [ ] sg - [ ] bw @@ -32,7 +35,7 @@ - [ ] sc2 - [ ] sg - [ ] bw -- [ ] Archive/Delete the TeamList modules (i.e. the conversion wrappers) and `Template:TeamList` +- [ ] Archive/Delete the TeamList modules (i.e. the conversion wrappers) on commons and `Template:TeamList` on the 3 wikis - [ ] commons - [ ] sc2 - [ ] sg From 0a2b7f61232332f11de3cd6045b75b0616986ee2 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 09:53:41 +0200 Subject: [PATCH 32/40] fix todos & linter stuff --- lua/wikis/commons/TeamList/Starcraft.lua | 18 +++--------------- .../commons/TeamList/Starcraft/TeamCard.lua | 6 ++++-- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index 5129f34780f..15874e6be6a 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -3,14 +3,6 @@ -- page=Module:TeamList/Starcraft -- ---[[ - -todo: -- sections marked with todo (especially mapping ...) -- debug - -]] - local Arguments = require('Module:Arguments') local Array = require('Module:Array') local Class = require('Module:Class') @@ -54,15 +46,11 @@ function TeamListWrapper.TemplateTeamList(frame) local teamList = TeamList(args):read() - mw.logObject(teamList) -- todo: remove once mapping works - - local newArgs = teamList:map() -- todo + local newArgs = teamList:map() -- throw the class away to not clog up memory ---@diagnostic disable-next-line: cast-local-type teamList = nil - mw.logObject(newArgs) -- todo: remove once mapping works - if Logic.readBool(args.generate) then TeamListWrapper.generate(newArgs) end @@ -145,7 +133,7 @@ function TeamListWrapper.generateOuterConfig(args) return '|' .. param .. '=' .. value end) - local store = args.store == false and 'false' or 'false' -- todo: double check if includeonly or onlyinclude ... + local store = args.store == false and 'false' or 'false' table.insert(parts, '|store=' .. store) return table.concat(parts) @@ -278,7 +266,7 @@ function TeamList.mapPlayer(player) if player.dnp then args.played = 'false' end - local role = player.captain and 'Captain' or nil + args.role = player.captain and 'Captain' or nil if player.dq then args.status = 'former' diff --git a/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua index e8ccb51c9be..519e3a6b07c 100644 --- a/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua +++ b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua @@ -75,7 +75,9 @@ function TeamCard:readOpponent() local args = self.args local date = args.date or getContextualDateOrNow() local team = (args.team or 'tbd'):lower():gsub('_', ' ') - local opponent = Opponent.resolve(Opponent.readOpponentArgs{team, type = Opponent.team}, date) --[[@as StarcraftTeamCardOpponent]] + local opponent = Opponent.resolve( + Opponent.readOpponentArgs{team, type = Opponent.team}, date + ) --[[@as StarcraftTeamCardOpponent]] opponent.dq = Logic.readBool(args.dq) opponent.date = date @@ -86,7 +88,7 @@ function TeamCard:readOpponent() end)) if #opponent.players >= 35 then - mw.ext.TeamLiquidIntegration.add_category('TeamCards with 35 players') + mw.ext.TeamLiquidItegration.add_category('TeamCards with 35 players') elseif #opponent.players >= 25 then mw.ext.TeamLiquidIntegration.add_category('TeamCards with 25 players') elseif #opponent.players >= 20 then From b8efae14c0cbe78ee75eefeb563985603d62191c Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 09:56:24 +0200 Subject: [PATCH 33/40] kick the md (moved to PR summary) --- TeamListConversion.md | 49 ------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 TeamListConversion.md diff --git a/TeamListConversion.md b/TeamListConversion.md deleted file mode 100644 index 46cb1e59fba..00000000000 --- a/TeamListConversion.md +++ /dev/null @@ -1,49 +0,0 @@ -# Conversion of Template:TeamList - -## Affected Wikis -- stormgate: 8 pages -- starcraft2: ~600 pages -- starcraft: ~2k pages - -## Steps -- [x] Convert all Template:TeamList/Team calls to Template:TeamCard calls -- [x] Delete Template:TeamList/Team -- [x] Convert all usages of pure TeamCard calls (usually with box stuff arround them) to use TeamList wrapper (TeamCard already uses TeamList under the hood) -- [x] Clean up `Toggle group start`/`Toggle group end` usages in combi with TeamList -- [ ] Write conversion wrapper (as dev of `TeamList` modules) - - [x] initial - - [ ] test & debug - - [ ] perf test -- [ ] wait for necessary features of TeamParticipants for using wrapper - - [ ] check if the sc(2) specific TC "roles" (captain, 2v2) work in TeamParticipants, if not see how to make them work - - [ ] check if combi of DNP & captain "role" work in TeamParticipants, if not see how to make it work -- [ ] Inplace replace TeamList modules with the conversion wrapper -- [ ] wait for necessary features of TeamParticipants - - [ ] #6872 - - [ ] #7319 -- [ ] start using TeamParticipants on new pages -- [ ] Replace `TeamCard` and `TeamList/Section` usage with jsons (`subst:#json:`, TeamCard already does ecaxtly that when reaching this point, `TeamList/Section` only adds a single param (`|type=section`)) - - [ ] sc2 - - [ ] sg - - [ ] bw -- [ ] Delete `Template:TeamCard` on all 3 wikis & delete `Template:TeamList/Section` on commons - - [ ] sc2 - - [ ] sg - - [ ] bw - - [ ] commons -- [ ] If there are no issues mentioned within X months after inplace conversion start a (subst) replace run to use the option of the conversion wrapper to generate the wiki code - - [ ] sc2 - - [ ] sg - - [ ] bw -- [ ] Archive/Delete the TeamList modules (i.e. the conversion wrappers) on commons and `Template:TeamList` on the 3 wikis - - [ ] commons - - [ ] sc2 - - [ ] sg - - [ ] bw - -## Conversion wrapper -- Basically mirror what TeamList modules do (import auto dnp etc pp) just without display and without storage -- Instead of display/storage convert the collected data to new params and call TeamParticipants with them - - If section stuff is used each section has to call TeamParticipants stuff and then wrap all the TeamParticipants calls into Tabs dynamic -- Add an **option** to generate wiki code instead of calling TeamParticipants -- Add a check that adds a cleanup category if it finds `'<%s*br%s*/?>'` in any of the inputs From d2f18a236358a581c36221520d99e6089a3362bb Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 09:57:39 +0200 Subject: [PATCH 34/40] shut up linter (i want to throw it away...) --- lua/wikis/commons/TeamList/Starcraft.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index 15874e6be6a..eebab772658 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -48,8 +48,10 @@ function TeamListWrapper.TemplateTeamList(frame) local newArgs = teamList:map() -- throw the class away to not clog up memory + -- luacheck: ignore ---@diagnostic disable-next-line: cast-local-type teamList = nil + -- luacheck: pop if Logic.readBool(args.generate) then TeamListWrapper.generate(newArgs) From f722606baaf662553ac733d9a3afba36a9f567ca Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 09:58:38 +0200 Subject: [PATCH 35/40] this seems better --- lua/wikis/commons/TeamList/Starcraft.lua | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index eebab772658..8b90bda5e78 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -44,14 +44,7 @@ function TeamListWrapper.TemplateTeamList(frame) end end - local teamList = TeamList(args):read() - - local newArgs = teamList:map() - -- throw the class away to not clog up memory - -- luacheck: ignore - ---@diagnostic disable-next-line: cast-local-type - teamList = nil - -- luacheck: pop + local newArgs = TeamList(args):read():map() if Logic.readBool(args.generate) then TeamListWrapper.generate(newArgs) From 4e34f0221cb20e1a51747f15d6dadc5ca8933ff8 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 10:02:55 +0200 Subject: [PATCH 36/40] deploy headers --- lua/wikis/commons/TeamList/Starcraft.lua | 4 +++- lua/wikis/commons/TeamList/Starcraft/TeamCard.lua | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index 8b90bda5e78..3d460851d8b 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -1,7 +1,9 @@ --- --- for @Liquipedia by @hjpalpha +-- @Liquipedia -- page=Module:TeamList/Starcraft -- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- local Arguments = require('Module:Arguments') local Array = require('Module:Array') diff --git a/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua index 519e3a6b07c..f18e7a578c2 100644 --- a/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua +++ b/lua/wikis/commons/TeamList/Starcraft/TeamCard.lua @@ -1,7 +1,9 @@ --- --- for @Liquipedia by @hjpalpha +-- @Liquipedia -- page=Module:TeamList/Starcraft/TeamCard -- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- local Lua = require('Module:Lua') From 1f42af1567d8b9e4b3adf9184998866c9b505dfa Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 11:01:59 +0200 Subject: [PATCH 37/40] never import with the new stuff as it fucks things up --- lua/wikis/commons/TeamList/Starcraft.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index 3d460851d8b..3f96be8fde4 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -233,6 +233,7 @@ function TeamList.mapEntry(entry) local opp = entry.opponent local notes = {opp.note} local args = { + import = 'false', --- disallow this shit as it just fucks up things ... players = Array.map(opp.players, function(player) table.insert(notes, player.note) return TeamList.mapPlayer(player) From 8179d8930b2f3d96a4510228843c426532bad4e2 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 11:26:57 +0200 Subject: [PATCH 38/40] a return is a good idea ... --- lua/wikis/commons/TeamList/Starcraft.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index 3f96be8fde4..bd0fd106317 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -223,7 +223,7 @@ function TeamList:map() Array.sortInPlaceBy(section.entries, function(entry) return entry.name:lower() end) end - Table.mergeInto(args, Array.map(section.entries, TeamList.mapEntry)) + return Table.mergeInto(args, Array.map(section.entries, TeamList.mapEntry)) end) end From 86e06cf2c73a83c94d543d9cb1c60fa6159673e1 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 11:34:15 +0200 Subject: [PATCH 39/40] sc2 ingame role ... --- lua/wikis/starcraft2/InGameRoles.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lua/wikis/starcraft2/InGameRoles.lua diff --git a/lua/wikis/starcraft2/InGameRoles.lua b/lua/wikis/starcraft2/InGameRoles.lua new file mode 100644 index 00000000000..cbe3ef6b41d --- /dev/null +++ b/lua/wikis/starcraft2/InGameRoles.lua @@ -0,0 +1,13 @@ +--- +-- @Liquipedia +-- page=Module:InGameRoles +-- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- + +---@type table +local inGameRoles = { + ['captain'] = {category = 'Captain', display = 'Captain'}, +} + +return inGameRoles From 55f649dc4a19c02ebdeaf631dbd9c909e03e30c1 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Tue, 12 May 2026 11:39:20 +0200 Subject: [PATCH 40/40] stringify (so bools do not break the generator) --- lua/wikis/commons/TeamList/Starcraft.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/TeamList/Starcraft.lua b/lua/wikis/commons/TeamList/Starcraft.lua index bd0fd106317..57f05d89cac 100644 --- a/lua/wikis/commons/TeamList/Starcraft.lua +++ b/lua/wikis/commons/TeamList/Starcraft.lua @@ -175,7 +175,7 @@ function TeamListWrapper.generatePlayer(args) local add = function(param) local value = args[param] if Logic.isEmpty(value) then return end - table.insert(parts, '|' .. param .. '=' .. value) + table.insert(parts, '|' .. param .. '=' .. tostring(value)) end local params = { @@ -210,7 +210,7 @@ function TeamList:map() local args = { title = section.title or config.title, - showplayerinfo = config.playerInfoButton, + showplayerinfo = config.playerInfoButton and 'true' or nil, date = config.resolveDate, store = not config.noStorage, }