Commit Graph
63 Commits
Author SHA1 Message Date
tiennm99 b2f33d0266 build: move web/ from pnpm to npm
Replace pnpm-lock.yaml with package-lock.json. The three security overrides
move from pnpm-workspace.yaml to package.json#overrides, where npm reads them
natively. Only the postcss floor is still live; @babel/core and js-yaml left
the tree with Next.js but are kept so the declared floors survive if a
dependency reintroduces them.
2026-08-17 12:24:21 +07:00
tiennm99 c1a209806c chore: wire up monorepo layout after absorbing loldle-data and loldle-android
Workflows move to the repo root: deploy and CI build from web/, and a single
update-champions workflow replaces the old two-repo pipeline (scrape in data/,
copy into web/static/, redeploy). Go module becomes
github.com/tiennm99/loldle/data. Root README maps the three parts.
2026-08-10 16:29:55 +07:00
tiennm99 084e5e5e43 Initial commit 2026-07-26 13:03:04 +07:00
tiennm99 759adcf876 chore: remove dependabot version-update config
Drops .github/dependabot.yml, which existed solely to opt into routine
version updates. Dependabot alerts and security updates are repo-level
settings and both stay enabled, so vulnerabilities are still reported and
still get automated fix PRs.

What stops: weekly npm bumps and monthly GitHub Actions bumps. Non-vulnerable
dependencies now drift until a security advisory forces the issue.

Original config recoverable from 30670c8.
2026-07-25 12:14:11 +07:00
tiennm99 45237e174f Merge pull request #25 from tiennm99/dependabot/npm_and_yarn/minor-and-patch-4481dc1bf1
build(deps-dev): bump svelte from 5.56.7 to 5.56.8 in the minor-and-patch group across 1 directory
2026-07-25 11:48:35 +07:00
tiennm99 fbd311bdea Merge pull request #23 from tiennm99/dependabot/npm_and_yarn/eslint-10.8.0
build(deps-dev): bump eslint from 9.39.5 to 10.8.0
2026-07-25 11:45:28 +07:00
tiennm99 c31ceda3fb Merge pull request #24 from tiennm99/feat/sveltekit
Migrate from Next.js to SvelteKit
2026-07-25 11:20:42 +07:00
tiennm99 eae345ecbb chore: remove Next.js and repoint CI at the SvelteKit layout
sync-data.yml now writes static/champions.json. This is the edit that had to
land with the deletion of public/: the workflow reports success regardless of
which path it writes, so a miss would have left the weekly sync green while
the live game 404'd on data load.

deploy.yml publishes build/ and passes BASE_PATH. Adds ci.yml, which runs
test, lint, and build on pull_request and pushes to main -- the repo had no
PR-triggered workflow before, so 'green before merge' was previously
unenforceable.

Deletes app/, components/, lib/, public/, next.config.mjs and
postcss.config.mjs, drops the Next and React dependencies, and swaps ESLint
onto eslint-plugin-svelte. sharp and unrs-resolver left pnpm's allowBuilds
because both arrived with Next and pnpm why now reports no dependents.
2026-07-25 11:18:58 +07:00
tiennm99 5f6b8b76c6 feat: rewrite components in Svelte 5 runes
Port all six React components. State becomes $state, memos become $derived,
and the gameRef mirror that existed only to dodge a stale closure is gone --
runes read current values at call time, so one $state holds the game.

Initialization moves to onMount rather than $effect: the page is prerendered,
so loadChampions and localStorage must be browser-only, and onMount encodes
that structurally instead of relying on the effect body happening to read no
reactive state.

champion-search becomes a real combobox/listbox: input carries the combobox
role with aria-expanded and aria-activedescendant, options are list items
wrapping buttons, and Escape closes the dropdown. Visual output is unchanged.

next/image becomes plain img -- every usage already passed unoptimized.
2026-07-25 11:14:35 +07:00
tiennm99 078d80c962 refactor: port lib layer to src/lib
classic-mode.js moves byte-for-byte. champion-data.js swaps the Next.js
env-var fetch prefix for asset() from $app/paths, which resolves to
/champions.json in dev and /loldle/champions.json in the deployed build.
getChampionImageUrl keeps returning an absolute Data Dragon URL, unwrapped.

Drops three exports with no callers: getAllChampions, getChampionByName,
getGuessedNames.

The characterization suite passes unchanged against the new location -- only
import specifiers moved, no assertions touched.
2026-07-25 11:01:40 +07:00
tiennm99 e2ae34a8ab build: scaffold SvelteKit alongside the Next.js app
Add svelte.config.js (adapter-static, BASE_PATH-driven base), vite.config.js
(Tailwind v4 Vite plugin ahead of sveltekit), the src/ shell, and static/
holding a copy of champions.json plus .nojekyll.

Declares "type": "module" so Vite can load the .js config files; Next.js was
only unaffected because all its configs use .mjs. jsconfig keeps the @/* alias
so pnpm next:build stays runnable for side-by-side comparison during the port.

Next.js scripts move to next:* and both toolchains build from this commit.
2026-07-25 11:00:14 +07:00
tiennm99 d0c75e84b1 test: add characterization tests for lib layer
Cover classic-mode comparison rules, game-engine state machine and
localStorage persistence, and champion-data search/seeding/loading with
Vitest. Storage keys are asserted literally so returning players' saved
games and stats cannot silently break.

Node environment with a hand-rolled localStorage stub; fixtures are four
hand-written champions so the weekly data sync cannot destabilise the
suite.
2026-07-25 10:54:36 +07:00
tiennm99 4b8bda7a1d ci: pull champions data on Thursdays after upstream scrape
loldle-data scrapes Thursday 06:00 UTC but GitHub queues it 2-4h late, so pull at 12:00 UTC the same day instead of the following Monday.
2026-07-25 10:07:28 +07:00
tiennm99 d2bf2a39a2 ci: pull champions data from loldle-data weekly
Replaces the upstream push-based fan-out with a scheduled pull, so this repo owns its own data refresh. Deploy is dispatched explicitly because a GITHUB_TOKEN push does not trigger workflows.
2026-07-25 09:52:11 +07:00
tiennm99 47389c7255 build(deps): update dependencies and patch advisories
- bump actions/checkout to v7 and actions/setup-node to v7
- bump next to 16.2.10, react and react-dom to 19.2.7
- bump eslint-config-next to 16.2.10, tailwindcss and
  @tailwindcss/postcss to 4.3.3, eslint to 9.39.5
- override @babel/core, js-yaml, and postcss to patched versions
- move pnpm build allowlist to pnpm-workspace.yaml
2026-07-17 17:57:20 +07:00
tiennm99 00576bfa32 chore: add dependabot config (#4) 2026-05-23 10:48:39 +07:00
tiennm99 423fbf63fa chore(ci): bump node to 24 2026-05-13 10:52:26 +07:00
tiennm99 408eee818a fix(ci): skip build scripts to avoid pnpm 11 ERR_PNPM_IGNORED_BUILDS 2026-05-13 10:31:03 +07:00
tiennm99 dba51c19e7 fix(ci): bump node to 22 for pnpm 11 compatibility 2026-05-13 10:29:48 +07:00
tiennm99 750d825e01 fix(ci): migrate workflow from npm to pnpm 2026-05-13 10:28:40 +07:00
tiennm99 bb8ae531b6 Merge remote-tracking branch 'origin/main' 2026-05-13 10:22:10 +07:00
tiennm99 64669cae4e docs: flesh out README 2026-05-11 20:15:11 +07:00
tiennm99 40ffc980af chore: migrate from npm to pnpm 2026-05-13 10:21:09 +07:00
tiennm99 810b5faa14 feat: show newest guess on top of the grid (#2) 2026-04-20 18:30:00 +07:00
tiennm99 407166d033 update README credits to reference loldle-data repo 2026-04-06 11:04:02 +07:00
tiennm99 9b32b8889c fix: use local date for daily seed instead of UTC
toISOString() returned UTC date, causing the daily game to reset at
UTC midnight rather than local midnight. Users in UTC+ timezones
would see yesterday's completed game until the UTC date rolled over.
2026-04-05 01:14:37 +07:00
tiennm99 31d7127396 feat: clear expired daily game cache from localStorage on app load 2026-04-05 00:55:15 +07:00
tiennm99 e502d43a9c add chrome-dev-tools to gitignore 2026-04-05 00:55:10 +07:00
tiennm99 bc5a0784b3 fix: derive basePath from repository name in CI workflow 2026-04-04 12:26:56 +07:00
tiennm99 a130dd191b fix: make basePath configurable via NEXT_PUBLIC_BASE_PATH env var
Enables platform-agnostic deployment — GitHub Pages sets the env var
in CI, while Vercel/Netlify/local dev default to root path.
2026-04-04 12:24:39 +07:00
tiennm99 dc7603459f fix: set basePath for GitHub Pages deployment
Assets and routes now correctly resolve under /loldle subdirectory.
2026-04-04 12:23:16 +07:00
tiennm99 f298ddddc2 ci: add GitHub Pages deployment workflow
- Configure Next.js static export (output: "export")
- Add GitHub Actions workflow to build and deploy on push to main
2026-04-04 11:55:29 +07:00
tiennm99 d9ae9c97d2 refactor: migrate from vanilla JS to Next.js 16 with Tailwind CSS
- Replace vanilla HTML/CSS/JS with Next.js App Router + React components
- Game logic (champion-data, game-engine, classic-mode) moved to lib/
- UI split into modular components (game-board, champion-search, guess-grid, etc.)
- Add Tailwind CSS v4 with CSS variables for theming
- Immutable state updates, fetch deduplication, next/image for CDN images
- champions.json moved from assets/ to public/
2026-04-04 11:52:59 +07:00
tiennm99 9572f39f59 feat: implement LoLdle Classic mode with daily and unlimited play
Vanilla JS web game with modular architecture:
- data-loader: champion data fetching, seeded random selection
- game-engine: mode-agnostic state machine with localStorage persistence
- classic-mode: 7-attribute comparison logic (gender, genre, range, resource, region, lane, year)
- ui-renderer: search autocomplete, colored feedback grid, stats display
- Dark theme responsive UI with Data Dragon CDN champion images
2026-04-04 11:17:47 +07:00
tiennm99 d8d7d8e721 feat: add champions data asset 2026-04-04 10:42:57 +07:00
tiennm99 1e1146b386 Initial commit 2026-04-04 10:41:37 +07:00
tiennm99 e0a9d329bf Merge pull request #1 from tiennm99/dependabot/go_modules/golang.org/x/net-0.55.0
chore(deps): bump golang.org/x/net from 0.52.0 to 0.55.0
2026-07-25 10:29:56 +07:00
tiennm99 234703072e ci: remove champions sync to archived downstream repo
The loldle repo is archived and read-only, so every push after a data
update failed with a 403. Consumers read champions.json from this repo
directly instead.

Checkout no longer overrides the token: the PAT existed only so the data
commit would trigger the sync workflow, and contents: write on the
default GITHUB_TOKEN covers the push.
2026-07-25 10:27:57 +07:00
tiennm99 0af3e23c14 docs(readme): expand from 83B — add what/usage/output/used-by sections 2026-05-11 21:42:18 +07:00
tiennm99 969c08603d ci: drop miti99bot from champions sync targets 2026-04-22 13:34:47 +07:00
tiennm99 baeea6876e chore: sync CHAMPIONS.md with reverted Zaahen data 2026-04-21 10:03:23 +07:00
tiennm99 c446f08c2f feat(docs): regenerate CHAMPIONS.md from champions.json in scraper
- Add saveMarkdown in markdown.go rendering the Loldle classic-mode column
  table (Champion | Gender | Genre | Range | Resource | Region | Lane | Year).
- main.go writes CHAMPIONS.md after champions.json on every scrape.
- update-champions.yml stages CHAMPIONS.md alongside champions.json so CI
  commits both in lockstep.
- alt text on tile images now uses champion display name (e.g. Bel'Veth)
  instead of the ID slug.
2026-04-21 10:03:07 +07:00
tiennm99 3824945eaa docs: add CHAMPIONS.md table view of champions.json 2026-04-21 10:03:07 +07:00
tiennm99 3eb72ecfc0 test(data): set Zaahen lane=top,jungle + releaseDate=2026 to verify sync chain 2026-04-20 21:18:55 +07:00
tiennm99 be2df323e7 refactor(ci): split scrape and sync into two workflows
- update-champions.yml: cron/manual only, scrapes + commits
  champions.json. Uses LOLDLE_PAT so the push retriggers sync.
- sync-champions.yml: runs on push to champions.json (or manual
  dispatch), fans out to downstream repos via the sync_repo helper.

Single responsibility per workflow; chained via the push trigger.
2026-04-20 21:16:52 +07:00
tiennm99 aa882b5c3b ci: fan out downstream sync on manual pushes too
Add push trigger (paths: champions.json) so direct edits to
champions.json auto-sync to miti99bot and loldle without needing a
workflow_dispatch. Scraper + commit steps skip on push events (the
data is already committed); sync step runs when either changed=true
from the scraper path OR the trigger is push. Default GITHUB_TOKEN
commits don't retrigger workflows, so no self-loop.
2026-04-20 21:14:41 +07:00
tiennm99 7dd369a46e chore(ci): remove sync-champions.yml — superseded by update-champions.yml fan-out 2026-04-20 21:12:59 +07:00
tiennm99 afdfc6376c refactor(ci): unify downstream sync into one step with shell function
- Single LOLDLE_PAT secret for all downstream repos (miti99bot + loldle).
- sync_repo() takes (repo, dest-path, optional post-copy command);
  add a target by appending one line.
- DRYs up duplicate clone/copy/commit/push blocks.
2026-04-20 21:08:34 +07:00
tiennm99 7eed27ba52 ci: also push champions data to loldle repo
Mirrors the miti99bot push step — clones tiennm99/loldle, copies
champions.json into public/, commits and pushes. Gated on
LOLDLE_PUSH_TOKEN secret; step is a no-op when unset.
2026-04-20 18:34:32 +07:00
tiennm99 859eff4c82 ci: push champions data directly to miti99bot repo
Replaces the repository_dispatch notification flow. After a successful
champions.json commit in loldle-data, this workflow now clones
miti99bot, copies the file, regenerates champions-data.js via the
project's build script, and commits+pushes to miti99bot main.

Token secret renamed MITI99BOT_DISPATCH_TOKEN -> MITI99BOT_PUSH_TOKEN
to reflect the new scope (contents:write on tiennm99/miti99bot).
2026-04-20 18:33:30 +07:00
tiennm99 80bbf3a641 ci: dispatch miti99bot sync event after champions update
After a successful commit of champions.json, send a repository_dispatch
(type: loldle-data-updated) to tiennm99/miti99bot so its sync workflow
pulls the latest data into its loldle module. No-op when
MITI99BOT_DISPATCH_TOKEN is unset.
2026-04-20 17:10:28 +07:00
tiennm99 428f21bcea fix: upgrade GitHub Actions to Node.js 24-compatible versions
Bump actions/checkout v4→v5 and actions/setup-go v5→v6 to resolve
Node.js 20 deprecation warnings.
2026-04-16 15:02:05 +07:00
tiennm99 04dcf74746 fix: add write permissions to update-champions workflow
The workflow failed because the default GITHUB_TOKEN lacked write
access, causing `git push` to return 403.
2026-04-16 14:42:05 +07:00
tiennm99 c55cf36517 feat: add weekly workflow to auto-update champions data 2026-04-05 12:16:48 +07:00
tiennm99 1778ca9db9 fix: update champions.json with latest skin counts 2026-04-05 12:14:10 +07:00
tiennm99 eddcfe25fa feat: auto-detect latest champions version from Riot API
When championsVersion is empty, fetch the latest version from
ddragon.leagueoflegends.com instead of requiring a hardcoded value.
2026-04-05 12:13:43 +07:00
tiennm99 a12b5d2b5d fix: disable HTML escaping in JSON output for & characters 2026-04-05 00:29:00 +07:00
tiennm99 23be5513e4 fix: use MediaWiki API for wiki scraping to bypass Cloudflare
Direct wiki page requests return 403 due to Cloudflare JS challenge.
Switch to MediaWiki parse API which returns rendered HTML without
blocking. Also match img[alt='Official'] in lane detection.
2026-04-05 00:14:13 +07:00
tiennm99 090082a51d fix: use typed ChampionImage struct for correct JSON key order 2026-04-04 20:31:12 +07:00
tiennm99 234d557bcc feat: sort champions alphabetically by name 2026-04-04 18:58:36 +07:00
tiennm99 1e7a05e591 feat: add champions.json sync workflow to loldle repo
Track champions.json in git and add GitHub Action that copies it
to tiennm99/loldle/public/champions.json on push.
2026-04-04 18:41:47 +07:00
tiennm99 cfa664f217 feat: rewrite LoLdleData in Go
4-stage pipeline: fetch ddragon champions, enrich with release dates
(wiki scrape), regions (Universe API), and lanes (wiki scrape).
Concurrent gender detection via goroutines with semaphore.
2026-04-04 18:06:48 +07:00
tiennm99 361e09910b Initial commit 2026-04-04 17:19:15 +07:00