Commit Graph

135 Commits

Author SHA1 Message Date
Josh Creek 7240376e00 feat(pokedex): add shareable read-only dex links 2026-09-14 14:25:09 +01:00
Josh Creek 3ea194f87c fix: harden review findings and Netlify install 2026-09-14 12:56:09 +01:00
Josh Creek 86f1c21e4d fix: remediate branch review findings 2026-09-14 11:47:58 +01:00
Josh Creek 3a2c18bbeb fix: repair defects surfaced by gating CI on lint and typecheck
`npm run check` reported 15 errors and `npm run lint` 20, all pre-existing, so
neither gate could pass. Fixing them turned up three real bugs:

- SignOut destructured `{ error }` off `.then(() => {})`, which resolves to
  undefined, so every sign-out threw a TypeError - after the signed-out event had
  already been emitted. Sign-out also left the user on the protected page they
  were on, still showing its content; it now returns them to the home page and
  re-runs the server loads.

- SignUp passed `redirectTo`, which is not a signUp option and was silently
  ignored, so the confirmation link has always used Supabase's configured site
  URL. Documented rather than changed, since pointing it elsewhere needs an
  absolute allow-listed URL.

- The Pokédex page tracked totalRecordsCreated but never passed it to the box
  view, so the "Processed N entries so far" progress message never rendered.

The rest is typing and dead code: cookie callback parameters in hooks.server.ts
and +layout.ts, the untyped supabase props, a query-builder type that made
PostgREST rows untyped downstream, an unused session destructure, and
`while (true)` paging loops rewritten as `for (;;)`.
2026-09-13 17:38:42 +01:00
Josh Creek 92d6460765 fix(export): restrict provider endpoint overrides to loopback test servers
The endpoint overrides are read through `$env/dynamic/private`, so they are
evaluated per request in production, not baked in at build time. That made a
single injected environment variable enough to redirect the authorization-code
and refresh-token POSTs - which carry the OAuth client secret and the user's
refresh token - to an arbitrary host, and to redirect the user's authorize hop
to an arbitrary URL.

Overrides are now ignored unless ALLOW_PROVIDER_ENDPOINT_OVERRIDES is exactly
"true" and the value is a loopback URL. `npm run test:bdd` sets the flag;
nothing else should. resolveProviderEndpoints is pure so the refusals are unit
tested, including near-miss hosts such as http://127.0.0.1.example.

Also drops the unused `pokedex` parameter from buildCsv rather than silencing it
with `void`, and the dead hasGigantamaxed field from its fallback record.
2026-09-13 17:38:42 +01:00
Josh Creek de39dc78ea test: replace ad-hoc tests with a layered suite and CI workflow
Splits testing into five layers so a failure points at the responsible one:

- tests/unit    isolated utility, repository and service tests
- tests/data    validates the tracked Pokémon, game, region and dex files
- tests/integration  schema, views, constraints, RLS and repositories
- tests/bdd     executable Gherkin for user-visible behaviour
- tests/build   service worker and manifest artifacts per build variant

Replaces the two Playwright specs in client-test/ and the two Vitest files in
test/. Adds a GitHub Actions workflow running the layers as separate jobs, a
mock OAuth provider server so the Drive and Dropbox scenarios never touch real
accounts, and a wrapper that reads the local Supabase keys from
`supabase status` rather than hard-coding them.

Extracts the pure formatting helpers out of PokedexExportService so they can be
unit tested, and makes the provider endpoints configurable so the mock server
can stand in for Google and Dropbox.
2026-09-13 17:38:41 +01:00
Josh Creek 08c5e3271c style: format tracked files and ignore generated data exports
`prettier --check .` failed on 22 files, so gating CI on `npm run lint` was
never going to pass. These changes are whitespace only.

Adds the two remaining generated data exports to .prettierignore so this class
of churn cannot recur, along with machine-local settings files.
2026-09-13 17:38:35 +01:00
Josh Creek 676490b800 style(data): reformat generated Pokédex data files
These two files are generated exports that prettier was not ignoring, so
`prettier --check .` failed on them. Reformatting is isolated here because the
diff is ~124k lines and would otherwise bury real changes.

The only semantic change in this commit is the apostrophe in Farfetch'd and
Sirfetch'd: U+0027 -> U+2019, matching the spelling the rest of the data
already used. Everything else is whitespace.
2026-09-13 17:34:35 +01:00
Josh Creek 7c32813cf2 fix: preserve default forms and complete dex mappings 2026-09-13 12:50:42 +01:00
Josh Creek 19e4d7b727 refactor(#91): Address PR comments 2026-06-16 15:46:12 +01:00
Josh Creek 8255fb4c67 fix(#91): correct form game coverage and fix canonical sort order 2026-06-16 15:28:07 +01:00
Josh Creek 955cba1aaa fix(forms): supplement game-scoped dex entries with alternate forms
When a Pokédex has a game scope set and isFormDex=true, alternate forms
were not appearing because game_pokedex_entries only contains base-form
Pokémon. This adds fetchFormsForGame() to pull supplemental form entries
from pokedex_entries filtered by gamesToCatchIn, then merges and sorts
them using the base form's regional dex number so ordering is preserved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 13:16:29 +01:00
Josh Creek c5a503f5b5 fix(my-pokedexes): preserve original desktop header and stack actions on mobile 2026-02-06 13:15:24 +00:00
Josh Creek 71cfbce7e3 feat(*): Add evolution data and notes 2026-01-25 17:19:51 +00:00
Josh Creek e55d511141 refactor(#89): Address PR comments 2026-01-24 17:40:59 +00:00
Josh Creek 86e8d6f5e6 refactor(#89): Address PR comments 2026-01-24 17:26:55 +00:00
Josh Creek 8141bd624b refactor(#89): Address PR comments 2026-01-24 17:18:57 +00:00
Josh Creek ab82f75dc6 feat(#89): Add backup functionality for google drive and dropbox 2026-01-24 13:32:10 +00:00
Josh Creek c5c63ab8ef feat(#84): Improve performance and efficiency of service worker 2026-01-22 21:21:57 +00:00
Josh Creek 606fcbb201 chore(*): Remove commented out code 2026-01-19 12:20:31 +00:00
Josh Creek dfa0569119 feat(*): Make pokemon sprite bigger 2026-01-19 12:18:25 +00:00
Josh Creek 0c25bba236 fix(*): Address PR comment 2026-01-18 13:18:55 +00:00
Josh Creek eba34158fe data(*): Fix remaining sprites 2026-01-18 13:14:18 +00:00
Josh Creek 71df0de3df fix(*): Address PR comments 2026-01-18 10:41:12 +00:00
Josh Creek 46351c9af0 data(*): Add final data changes 2026-01-17 23:30:40 +00:00
Josh Creek a26f38bca1 data(*): Improve ordering of forms 2026-01-17 21:08:21 +00:00
Josh Creek f302721119 data(*): Add working regenerated data structure 2026-01-17 20:39:55 +00:00
Josh Creek ee73c01afe feat(*): Change how data is set up 2026-01-16 21:11:21 +00:00
Josh Creek d437c05770 refactor(#48): Address PR comment 2026-01-10 21:50:56 +00:00
Josh Creek 9d14b2d2f1 refactor(#48): Address PR comments 2026-01-10 21:44:19 +00:00
Josh Creek ad8c8a847d feat(#48): Make box cells square on mobile 2026-01-10 21:35:14 +00:00
Josh Creek 23e8382bd1 chore(*): Remove console log 2026-01-10 21:15:21 +00:00
Josh Creek d50417ffef feat(#48): Add dark mode 2026-01-10 21:12:25 +00:00
Josh Creek a7d878fffd fix(#54): Address PR comments 2026-01-10 20:32:34 +00:00
Josh Creek c10b526b3e feat(#54): Remove search icon and improve sign in page 2026-01-10 20:23:13 +00:00
Josh Creek 75f7161b7a fix(#64): Address PR feedback 2026-01-10 19:25:29 +00:00
Josh Creek 5657c2b2ab fix(#64): Address PR comments 2026-01-10 18:45:57 +00:00
Josh Creek f17b350e4e fix(#64): Address PR comments 2026-01-10 18:27:01 +00:00
Josh Creek 68cc2a0712 fix(#64): Address PR comments 2026-01-10 17:06:52 +00:00
Josh Creek 7c68d121ce fix(#64): Address PR comments 2026-01-10 16:27:23 +00:00
Josh Creek adc96baa90 feat(#64): Improve the about page 2026-01-10 15:27:00 +00:00
Josh Creek 070604fb89 fix(#56): Address PR comments 2026-01-10 12:47:27 +00:00
Josh Creek b30be24fd5 feat(#56): Address PR comments 2026-01-10 12:37:43 +00:00
Josh Creek b1b6e63b6f refactor(#56): Improve how the dex updating is handled and the error messaging around it 2026-01-10 12:07:05 +00:00
Josh Creek 84c6de6b62 feat(#59): Add outlines to empty box cells 2026-01-10 10:23:21 +00:00
Josh Creek 789321ce03 feat(#57): Improve accessibility of dropdown 2026-01-10 10:12:22 +00:00
Josh Creek cb0773b03e feat(#57): Replace 'mark box as' buttons with dropdown for better ux 2026-01-09 22:21:01 +00:00
Josh Creek 8fa394f102 feat(#60): Add stats and filters to pokedex page 2026-01-09 21:51:21 +00:00
Josh Creek 35ee92df0c fix(#63): Enforce mutually exclusive catch states 2026-01-09 20:51:33 +00:00
Josh Creek ca6831d10a feat(#63): Improve the box view 2026-01-09 20:34:57 +00:00