From e1f7cdf64564a10bedb5cd221887afa17a54f6af Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Wed, 22 Apr 2026 13:49:38 +0700 Subject: [PATCH] refactor(loldle): trim module to current behavior only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit KV payload cleanup: - drop lastResultAt from stats (never read) - drop solved/giveup flags from game state (round is immediately replaced after finish, making the flags transient noise) - skip redundant saveGame on winning/giveup/out-of-guesses paths; startFreshGame overwrites anyway Code cleanup: - delete daily.js + daily.test.js (pickDaily/todayUtc were speculative "future use" — only pickRandom was wired in, inlined into handlers) - drop the dead switch default in compare.js - trim file preambles across the module Docs: rewrite README around current behavior with loldle.net as the sole data source; update scraper header to match the raw schema. --- .github/workflows/scrape-loldle-data.yml | 4 +- scripts/scrape-loldle-data.js | 18 ++--- src/modules/loldle/README.md | 87 +++++++++++---------- src/modules/loldle/compare.js | 81 +++++++++----------- src/modules/loldle/daily.js | 48 ------------ src/modules/loldle/flavor.js | 5 +- src/modules/loldle/handlers.js | 96 ++++++++---------------- src/modules/loldle/index.js | 4 +- src/modules/loldle/lookup.js | 5 +- src/modules/loldle/render.js | 11 +-- src/modules/loldle/state.js | 34 ++++----- tests/modules/loldle/daily.test.js | 40 ---------- 12 files changed, 140 insertions(+), 293 deletions(-) delete mode 100644 src/modules/loldle/daily.js delete mode 100644 tests/modules/loldle/daily.test.js diff --git a/.github/workflows/scrape-loldle-data.yml b/.github/workflows/scrape-loldle-data.yml index dfc21f9..0b45699 100644 --- a/.github/workflows/scrape-loldle-data.yml +++ b/.github/workflows/scrape-loldle-data.yml @@ -42,9 +42,7 @@ jobs: title: "data: weekly loldle.net champion refresh" body: | Automated weekly refresh of `src/modules/loldle/champions.json` - from loldle.net's JS bundle — the canonical source for all - classic-mode fields (`gender`, `species`, `resource`, - `attackType`, `region`, `lane`, `releaseDate`). + from loldle.net's JS bundle. Review the diff, merge, then run `npm run deploy` to ship. add-paths: src/modules/loldle/champions.json diff --git a/scripts/scrape-loldle-data.js b/scripts/scrape-loldle-data.js index 640dc98..6b3f7d7 100644 --- a/scripts/scrape-loldle-data.js +++ b/scripts/scrape-loldle-data.js @@ -1,19 +1,13 @@ #!/usr/bin/env node /** - * @file scrape-loldle-data — rebuilds src/modules/loldle/champions.json from - * loldle.net's JS bundle, the canonical source for the classic-mode axes: - * gender, species, resource, attackType, region, lane, releaseDate. + * @file Rebuilds src/modules/loldle/champions.json from loldle.net's JS + * bundle. The bundle embeds the full champion array in plaintext — one + * record per champion with fields: _id, championId, championName, gender, + * positions, species, resource, range_type, regions, release_date. * - * loldle.net embeds the full champion array in plaintext inside its JS bundle - * at `