Commit graph

91 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
0704c1e2ec chore: README.md is same in repo as package 2026-07-03 10:11:56 +02:00
Ayo
bf26d3e80a test: add tests 2026-07-02 20:31:29 +02:00
Ayo
35e9f4441e chore: update package manager 2026-06-24 14:21:01 +02:00
Ayo
deeae32bfd chore: new release package script 2026-06-22 21:58:45 +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
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
52e223f2dd chore: add package homepage 2026-04-03 23:30:45 +02:00
Ayo
1ae0e8b169 chore: adjust lib scripts for build and release 2026-04-03 23:19:40 +02:00
Ayo
011f285bf3 chore: update publish scripts 2026-04-03 23:12:20 +02:00
Ayo
6a3ce486df 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
Ayo
0555154ea6 chore: update workspace scripts 2026-04-03 15:31:20 +02:00
Ayo
dab366496e chore: organize pnpm workspaces 2026-04-03 14:13:11 +02:00
Ayo
cc50d990eb chore: update package repo 2026-04-03 12:03:05 +02:00
Ayo
29bcaace1e refactor: separate app & lib directories 2026-04-03 11:15:18 +02:00
Ayo
8824f9215b chore: site build & preview scripts 2026-04-03 10:54:19 +02:00
Ayo
a72421defe refactor: import mnswpr.css in user main.js 2026-04-03 03:38:12 +02:00
Ayo
2fbb7f69a8 chore: release v0.4.26
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 03:31:04 +02:00
Ayo
20c98e77a4 fix: export all inside dist dir 2026-04-03 03:30:56 +02:00
Ayo
ea9effe3ba chore: release v0.4.25
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 03:22:40 +02:00
Ayo
823b035d70 chore: release v0.4.24 2026-04-03 03:17:39 +02:00
Ayo
a6aae78396 chore: remove unused dep esbuild 2026-04-03 03:17:05 +02:00
Ayo
79b9b7b9eb chore: release v0.4.23 2026-04-03 03:10:01 +02:00
Ayo
f9e64cf234 chore: release v0.4.22 2026-04-03 03:09:31 +02:00
Ayo
dc544e61e1 chore: release v0.4.21
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 03:07:43 +02:00
Ayo
992c326c19 chore: release v0.4.20
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 03:07:00 +02:00
Ayo
ccdd995e18 chore: release v0.4.19
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 03:03:23 +02:00
Ayo
e6c41e34af chore: release v0.4.18
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 03:01:34 +02:00
Ayo
cbd7635759 chore: release v0.4.17
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 03:00:28 +02:00
Ayo
afa35ee79e chore: release v0.4.16
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 02:54:42 +02:00
Ayo
aa8a069afb chore: release v0.4.15
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 02:53:21 +02:00
Ayo
f66f8e6d52 chore: catch up package version 2026-04-03 02:52:17 +02:00
Ayo
709868ebf4 chore: release v0.0.7
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 02:50:23 +02:00
Ayo
86c46dc430 0.0.6
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 02:37:50 +02:00
Ayo
d101b6c9a7 chore: add exports to package.json 2026-04-03 02:37:41 +02:00
Ayo
d4decdf21f chore: update gh action release 2026-04-03 02:33:24 +02:00
Ayo
b36f1d4bc0 chore: release v0.0.5
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 02:17:48 +02:00
Ayo
40022df835 chore: release v0.0.4
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 02:14:56 +02:00
Ayo
9f9dbf7506 chore: release v0.0.3
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 02:11:54 +02:00
Ayo
b87b324ddd chore: release v0.0.2
Some checks failed
Release / release (push) Has been cancelled
2026-04-03 02:06:54 +02:00
Ayo
516f2f2f8c chore: make no test as warning 2026-04-03 02:06:39 +02:00
Ayo
304557163b feat: initial npm package @ayo-run/mnswpr 2026-04-03 02:02:50 +02:00
Ayo
8f5373b2a7 chore: release v0.4.14
Some checks failed
Release / release (push) Has been cancelled
2026-04-02 21:43:24 +02:00
Ayo
82b74dcbe2 chore: release v0.4.13
Some checks failed
Release / release (push) Has been cancelled
2026-04-02 21:31:04 +02:00
Ayo
2dfa43f157 chore: release v0.4.12
Some checks failed
Release / release (push) Has been cancelled
2026-04-02 21:22:19 +02:00