Commit graph

262 commits

Author SHA1 Message Date
Ayo
4fa88fb431 feat: reusable, time-windowed leaderboard (@cozy-games/leaderboard)
Extract the leaderboard into a generic, backend-agnostic package and add
rolling Today/Week/Month/All-Time windows, a web component, and local-first
development against the Firestore emulator.

Package (leaderboard/):
- LeaderBoardService: backend-agnostic core via a storage-adapter seam, with
  Firebase and Supabase adapters (Supabase client injected, no added dep)
- Rolling time windows (last 24h / 7d / 30d) with hover tooltips; top-N by score
- <cozy-leaderboard> web component built on web-component-base: compose the UI
  in HTML, configure the backend once in JS
- Every user-facing string is configurable (labels, tooltips, empty/loading/
  error messages, anonymous name) so i18n lives in the app; README + CONFIGURATION

App (mnswpr.com):
- Compose the board declaratively in index.html via <cozy-leaderboard>
- Nickname + randomized greeting bar; score submission through the element
- Legends: the current all-time leaders frozen into a static /legends page
- Firebase config and leaderboard namespace via Vite env vars; emulator-first
  local dev (VITE_FIRESTORE_EMULATOR)

Firebase schema-as-code:
- firebase.json, .firebaserc, firestore.rules (public reads, create-only scores,
  no client updates/deletes, namespace-generalized), empty indexes (rolling
  windows need none)
- prod (mw-*) vs dev/test (mw-test-*) separation by collection namespace
- emulator config, seed script, and docs (firebase-leaderboards.md,
  leaderboard-env-migration.md, AYO.md)

Utils/tests: UTC date-bucket helper (retained as metadata) with Vitest coverage.

Reviewed-on: https://git.ayo.run/ayo/mnswpr/pulls/1
Co-authored-by: Ayo <ayo@ayco.io>
Co-committed-by: Ayo <ayo@ayco.io>
2026-07-03 13:42:03 +02:00
Ayo
28b90b1dab chore: update readme 2026-07-03 10:32:15 +02:00
Ayo
207e253c69 chore: add sreenshot 2026-07-03 10:29:17 +02:00
Ayo
b6f43751d9 chore: manual npm login on publish 2026-07-03 10:14:32 +02:00
Ayo
8afd8942aa chore: release v0.4.36
Some checks failed
Release / release (push) Has been cancelled
2026-07-03 10:12:31 +02:00
Ayo
0704c1e2ec chore: README.md is same in repo as package 2026-07-03 10:11:56 +02:00
Ayo
8774bc8092 chore: update readme 2026-07-03 10:00:25 +02:00
Ayo
21bfce4c04 chore: refactor the release script 2026-07-03 09:16:32 +02:00
Ayo
2038badb13 chore: release v0.4.35
Some checks failed
Release / release (push) Has been cancelled
2026-07-02 21:54:45 +02:00
Ayo
76e95d20da refactor: flood-fill logic 2026-07-02 21:54:09 +02:00
Ayo
a1742e3a58 perf: win check now tracks safe cells revealed instead of scanning the whole grid 2026-07-02 21:17:29 +02:00
Ayo
a2d8d975ec refactor: separate globalEventHandlers from cell-specific event handlers 2026-07-02 21:10:53 +02:00
Ayo
749b47fe40 perf: track a small list of highlighted cells 2026-07-02 20:55:03 +02:00
Ayo
6e6cf2c4f8 perf: render timer less frequently 2026-07-02 20:46:46 +02:00
Ayo
bf26d3e80a test: add tests 2026-07-02 20:31:29 +02:00
Ayo
1bd3135dac perf: improve mines lookup 2026-07-02 20:31:14 +02:00
Ayo
81f310e7cc chore: initial agentic instructions 2026-07-02 19:32:52 +02:00
Ayo
35e9f4441e chore: update package manager 2026-06-24 14:21:01 +02:00
Ayo
8fcaeecf41 chore: release v0.4.34
Some checks failed
Release / release (push) Has been cancelled
2026-06-22 22:15:42 +02:00
Ayo
18a7713149 feat(app): remove links to npm & github 2026-06-22 22:15:31 +02:00
Ayo
b8a1116494 chore: release v0.4.33
Some checks failed
Release / release (push) Has been cancelled
2026-06-22 22:06:50 +02:00
Ayo
113492cb97 feat(app): link to version releaseReset 2026-06-22 22:06:28 +02:00
Ayo
deeae32bfd chore: new release package script 2026-06-22 21:58:45 +02:00
Ayo
04445774e3 chore: release v0.4.32
Some checks failed
Release / release (push) Has been cancelled
2026-06-22 21:57:13 +02:00
Ayo
d40089b630 fix: leader board gets duplicated when switching levels while previous is still loading 2026-06-22 21:50:08 +02:00
Ayo
832afc1128 chore: add vite build app monorepo script 2026-04-05 15:31:10 +02:00
Ayo
4f3897bfaf chore(lib): move vite config to lib dir 2026-04-04 01:22:04 +02:00
Ayo
d4228c60f3 chore: update publish scripts 2026-04-03 23:46:24 +02:00
Ayo
7b9529bddb chore: add publish:lib script 2026-04-03 23:35:22 +02:00
Ayo
ba91f1ec50 chore: remove publish in release script 2026-04-03 23:34:34 +02:00
Ayo
debc9495ae chore: release v0.4.31
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 23:33:25 +02:00
Ayo
f4763e711c chore: move lib publish script 2026-04-03 23:33:13 +02:00
Ayo
788fc2dfe1 chore: add publish script 2026-04-03 23:31:43 +02:00
Ayo
07ebca0834 chore: release v0.4.30
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 23:31:02 +02:00
Ayo
52e223f2dd chore: add package homepage 2026-04-03 23:30:45 +02:00
Ayo
60aee72af3 chore: release v0.4.29
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 23:27:04 +02:00
Ayo
3e524968f3 chore(lib): update release script 2026-04-03 23:22:11 +02:00
Ayo
af22f0908a chore: release v0.4.28
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 23:20:37 +02:00
Ayo
1ae0e8b169 chore: adjust lib scripts for build and release 2026-04-03 23:19:40 +02:00
Ayo
64ac0bbebb chore(lib): add minimal-mnswpr link to guide 2026-04-03 23:19:40 +02:00
Ayo
2328a7251a chore(lib): update user guide 2026-04-03 23:19:33 +02:00
Ayo
b56530bf92 feat: New guide to building a browser game using **mnswpr** 2026-04-03 23:18:23 +02:00
Ayo
011f285bf3 chore: update publish scripts 2026-04-03 23:12:20 +02:00
Ayo
2bf6cbe968 feat(app): top links to npm and github 2026-04-03 23:11:28 +02:00
Ayo
1075422a1d refactor: use options object as param for generateGrid 2026-04-03 23:11:28 +02:00
Ayo
5a682640c6 refactor(app): initialize loadingService once 2026-04-03 23:11:28 +02:00
Ayo
1a6f07e84f chore: initial pkg license & readme 2026-04-03 23:11:28 +02:00
Ayo
6a3ce486df chore: add publish script 2026-04-03 23:09:38 +02:00
Ayo
32bb31ecf1 chore: add publish script 2026-04-03 23:09:38 +02:00
Ayo
6b01a0272e chore(app): move build & preview scripts to app workspace 2026-04-03 23:09:38 +02:00