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>
43 lines
1.4 KiB
JSON
43 lines
1.4 KiB
JSON
{
|
|
"name": "monorepo",
|
|
"version": "0.0.1",
|
|
"private": true,
|
|
"description": "Classic Minesweeper browser game",
|
|
"author": "Ayo Ayco",
|
|
"type": "module",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/ayo-run/mnswpr"
|
|
},
|
|
"homepage": "https://mnswpr.com",
|
|
"scripts": {
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"dev": "vite app",
|
|
"start": "vite app",
|
|
"emulators": "npx -y firebase-tools emulators:start --only firestore",
|
|
"seed:emulator": "cd app && FIRESTORE_EMULATOR_HOST=127.0.0.1:8080 node ../scripts/seed-dev-scores.js",
|
|
"build": "vite build app",
|
|
"build:lib": "vite build lib",
|
|
"publish:lib": "node scripts/publish-lib.js",
|
|
"release": "pnpm build:lib && pnpm -F @ayo-run/mnswpr run release && pnpm publish:lib",
|
|
"build:preview": "pnpm -F app run build:preview",
|
|
"prepare": "husky",
|
|
"lint": "eslint .",
|
|
"lint:fix": "eslint . --fix"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/css": "^1.1.0",
|
|
"@eslint/js": "^10.0.1",
|
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
"bumpp": "^11.0.1",
|
|
"eslint": "^10.1.0",
|
|
"globals": "^17.4.0",
|
|
"husky": "^9.1.7",
|
|
"jsdom": "^29.1.1",
|
|
"simple-git": "^3.33.0",
|
|
"vite": "^8.0.3",
|
|
"vitest": "^4.1.9"
|
|
},
|
|
"packageManager": "pnpm@11.9.0+sha512.bd682d5d03fe525ef7c9fd6780c6884d1e756ac4c9c9fe00c538782824310dcf90e3ddc4f53835f06dfaebd5085e41855e0bcbb3b60de2ac5bbab89e5036f03b"
|
|
}
|