Skip to content

Commit 3bdd4e9

Browse files
authored
Merge pull request #1134 from WatWowMap/develop
Sync Dev to Main
2 parents b5ae271 + 51c3c35 commit 3bdd4e9

File tree

39 files changed

+1571
-166
lines changed

39 files changed

+1571
-166
lines changed

AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
5+
- React client code lives in `src/`, with shared UI in `src/components`, feature bundles in `src/features`, and hooks/services under `src/hooks`, `src/services`, and `src/utils`.
6+
- The Node.js API, GraphQL schema, and auth logic are in `server/src`; configs and migrations sit under `server/src/configs` and `server/src/db`.
7+
- Workspace packages in `packages/` expose shared config (`@rm/config`), localization, logging, masterfile data, and build plugins; treat them as the source of truth for cross-app utilities.
8+
- Static assets are sourced from `public/`, while built bundles land in `dist/`; avoid committing build artefacts or anything listed in `.gitignore`.
9+
10+
## Build, Test, and Development Commands
11+
12+
- `yarn install` – install workspace dependencies; rerun after pulling lockfile changes.
13+
- `yarn dev` – start the full dev stack (Nodemon backend + Vite) using local config.
14+
- `yarn watch` – Vite-only hot reload for rapid UI work when the API is proxied elsewhere.
15+
- `yarn build` – create a production bundle in `dist/`; ensure it succeeds before release PRs.
16+
- `yarn lint` / `yarn lint:fix` – run ESLint with the Airbnb ruleset; lint must pass pre-commit.
17+
- `yarn prettier` / `yarn prettier:fix` – enforce formatting for JS/JSX, CSS, HTML, and YAML.
18+
- `yarn config:env` and `yarn locales:generate` – regenerate env files and derived locales after editing base config or strings.
19+
20+
## Coding Style & Naming Conventions
21+
22+
- Prettier governs formatting (2-space indent, single quotes in JS, semicolons off); never hand-format conflicting styles.
23+
- Prefer functional React components, PascalCase for components, camelCase for helpers, and `use` prefixes for hooks.
24+
25+
## Testing Guidelines
26+
27+
- No dedicated Jest suite today; rely on `yarn lint`, type checks from editor tooling, and manual verification in a local dev session.
28+
- When adding backend features, exercise relevant GraphQL/REST paths via the dev server and document sanity checks in the PR description.
29+
30+
## Commit & Pull Request Guidelines
31+
32+
- Use Conventional Commits (`type(scope): summary`), matching existing history (e.g. `feat(map): add weather overlays`).
33+
- Each PR should describe scope, link related issues, list testing steps, and include screenshots or GIFs for UI changes.
34+
- Re-run `yarn lint`, `yarn build`, and integration steps touched by the change before requesting review.
35+
36+
## Localization Notes
37+
38+
- Update English copy only in `packages/locales/lib/human/en.json`; run `yarn locales:generate` to refresh derived languages.
39+
- When adding a new translation key (for example when calling `t('some_key')`), create the English entry in `packages/locales/lib/human/en.json` in the same change. NEVER use fallback strings.
40+
- Never edit generated locale files directly—the automation pipeline syncs translations downstream.

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1+
# [1.39.0-develop.8](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.7...v1.39.0-develop.8) (2025-09-24)
2+
3+
4+
### Bug Fixes
5+
6+
* ditto filtering ([2fe3af3](https://github.com/WatWowMap/ReactMap/commit/2fe3af358bd848810e8d63b3b7e442f70ad78da7))
7+
8+
# [1.39.0-develop.7](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.6...v1.39.0-develop.7) (2025-09-24)
9+
10+
11+
### Features
12+
13+
* estimated shiny probability for pokemon ([#1133](https://github.com/WatWowMap/ReactMap/issues/1133)) ([d44a3df](https://github.com/WatWowMap/ReactMap/commit/d44a3df6834e3752a129a2fa5706526076cd9144))
14+
15+
# [1.39.0-develop.6](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.5...v1.39.0-develop.6) (2025-09-23)
16+
17+
18+
### Bug Fixes
19+
20+
* translation ([5a02a6b](https://github.com/WatWowMap/ReactMap/commit/5a02a6b81ca3c559dd2fea41a0b4c5a382560ed1))
21+
22+
# [1.39.0-develop.5](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.4...v1.39.0-develop.5) (2025-09-23)
23+
24+
25+
### Bug Fixes
26+
27+
* localization ([f02e8cd](https://github.com/WatWowMap/ReactMap/commit/f02e8cd927d76c9191e7fe6ea909f6eec9a4a729))
28+
* refinements to interaction between gyms/stops and routes ([8c0ba37](https://github.com/WatWowMap/ReactMap/commit/8c0ba372db29e53f2b74215494a8b170feab192a))
29+
30+
# [1.39.0-develop.4](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.3...v1.39.0-develop.4) (2025-09-23)
31+
32+
33+
### Features
34+
35+
* Compact Route View ([#1131](https://github.com/WatWowMap/ReactMap/issues/1131)) ([795976e](https://github.com/WatWowMap/ReactMap/commit/795976e2ea9f68ba54ad5495bbf81af2716b4920))
36+
37+
# [1.39.0-develop.3](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.2...v1.39.0-develop.3) (2025-09-22)
38+
39+
40+
### Features
41+
42+
* display actual battle bonus via stationed pokemon ([ba51f47](https://github.com/WatWowMap/ReactMap/commit/ba51f47d6c90dc659427148d4cc025ed6bc89950))
43+
44+
# [1.39.0-develop.2](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.1...v1.39.0-develop.2) (2025-09-16)
45+
46+
47+
### Bug Fixes
48+
49+
* skip updated filtering if shortcode is present ([b0cfe13](https://github.com/WatWowMap/ReactMap/commit/b0cfe13876b9d81e70ce44c997f4accb48943609))
50+
51+
# [1.39.0-develop.1](https://github.com/WatWowMap/ReactMap/compare/v1.38.1-develop.1...v1.39.0-develop.1) (2025-09-16)
52+
53+
54+
### Features
55+
56+
* route share code ([4ac76d0](https://github.com/WatWowMap/ReactMap/commit/4ac76d00d53eb06966a94a525541302340b638de))
57+
58+
## [1.38.1-develop.1](https://github.com/WatWowMap/ReactMap/compare/v1.38.0...v1.38.1-develop.1) (2025-09-15)
59+
60+
61+
### Bug Fixes
62+
63+
* relative timer not updating ([72b0a8c](https://github.com/WatWowMap/ReactMap/commit/72b0a8cfb3fab2ce897b02e8517bb9c324d0cc80))
64+
165
# [1.38.0](https://github.com/WatWowMap/ReactMap/compare/v1.37.0...v1.38.0) (2025-09-10)
266

367

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactmap",
3-
"version": "1.38.0",
3+
"version": "1.39.0-develop.8",
44
"private": true,
55
"description": "React based frontend map.",
66
"license": "MIT",
@@ -149,6 +149,7 @@
149149
"i18next-http-backend": "2.5.2",
150150
"knex": "3.1.0",
151151
"leaflet": "1.9.4",
152+
"leaflet-arrowheads": "^1.4.0",
152153
"leaflet.locatecontrol": "0.81.0",
153154
"lodash": "^4.17.21",
154155
"moment-timezone": "^0.5.43",

packages/locales/lib/human/en.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@
377377
"with_ar": "With AR",
378378
"both": "Both",
379379
"without_ar": "Without AR",
380-
"shiny_probability": "Shiny probability: <0/>",
380+
"shiny_probability": "Shiny rate: <0/>",
381+
"shiny_sample": "{{percentage}}%: {{shiny}} shiny/{{checks}} checks since {{date}}",
381382
"exclude_quest_multi": "Exclude {{reward}}",
382383
"cluster_limit_0": "{{variable_0}} limit ({{variable_1}}) has been hit",
383384
"cluster_limit_1": "Please zoom in or narrow your filters",
@@ -660,7 +661,13 @@
660661
"version": "Version",
661662
"route_tags": "Route Tags",
662663
"routes": "Routes",
664+
"compact_route_view": "Compact Route View",
663665
"route_type": "Route Type",
666+
"route_short_code": "Route Share Code: ",
667+
"route_anchor_count_one": "{{count}} Route",
668+
"route_anchor_count_other": "{{count}} Routes",
669+
"shortcode_copied_to_clipboard": "Code copied to clipboard!",
670+
"copy_failed": "Copy failed",
664671
"routes_subtitle": "View in game routes and relevant information about them on the map",
665672
"description": "Description",
666673
"additional_info": "Additional Info",

packages/types/lib/scanner.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ export interface PokemonDisplay {
4141
location_card: number
4242
}
4343

44+
export interface PokemonShinyStats {
45+
shiny_seen: number
46+
encounters_seen: number
47+
since_date?: string
48+
}
49+
4450
export interface Defender extends PokemonDisplay {
4551
pokemon_id: number
4652
deployed_ms: number
@@ -223,7 +229,6 @@ export interface Pokemon {
223229
costume: number
224230
gender: Gender
225231
display_pokemon_id: number
226-
ditto_form: number
227232
weight: number
228233
height: number
229234
size: number

packages/types/lib/server.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export interface DbContext {
4646
hasShowcaseForm: boolean
4747
hasShowcaseType: boolean
4848
hasStationedGmax: boolean
49+
hasPokemonShinyStats?: boolean
50+
connection?: number
4951
}
5052

5153
export interface ExpressUser extends User {

packages/vite-plugins/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"@rm/logger": "*"
1717
},
1818
"devDependencies": {
19-
"vite": "^6.2.6"
19+
"vite": "^6.3.6"
2020
}
2121
}

server/src/filters/pokemon/Backend.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -430,16 +430,9 @@ class PkmnBackend {
430430
expire_timestamp_verified: !!pokemon.expire_timestamp_verified,
431431
updated: pokemon.updated,
432432
display_pokemon_id: pokemon.display_pokemon_id,
433-
ditto_form: pokemon.ditto_form,
434433
seen_type: pokemon.seen_type,
435434
changed: !!pokemon.changed,
436435
}
437-
if (result.pokemon_id === 132 && !result.ditto_form) {
438-
result.ditto_form = result.form
439-
result.form =
440-
state.event.masterfile.pokemon[result.display_pokemon_id]
441-
?.defaultFormId || 0
442-
}
443436
if (!result.seen_type) {
444437
if (result.spawn_id === null) {
445438
result.seen_type = result.pokestop_id ? 'nearby_stop' : 'nearby_cell'

server/src/graphql/resolvers.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ const resolvers = {
2424
JSON: GraphQLJSON,
2525
Query: {
2626
available: (_, _args, { Event, Db, perms }) => {
27+
const supportsShinyStats = Array.isArray(Db.models?.Pokemon)
28+
? Db.models.Pokemon.some(({ SubModel, ...ctx }) =>
29+
typeof SubModel.supportsShinyStats === 'function'
30+
? SubModel.supportsShinyStats(ctx)
31+
: false,
32+
)
33+
: false
34+
2735
const data = {
2836
questConditions: perms.quests ? Db.questConditions : {},
2937
masterfile: { ...Event.masterfile, invasions: Event.invasions },
@@ -36,6 +44,7 @@ const resolvers = {
3644
...config.getSafe('icons'),
3745
styles: Event.uicons,
3846
},
47+
supportsShinyStats,
3948
}
4049
return data
4150
},
@@ -269,6 +278,23 @@ const resolvers = {
269278
}
270279
return {}
271280
},
281+
pokemonShinyStats: async (_, args, { perms, Db }) => {
282+
if (!perms?.pokemon) {
283+
return null
284+
}
285+
const sources = Db.models?.Pokemon
286+
if (!Array.isArray(sources)) {
287+
return null
288+
}
289+
const results = await Promise.all(
290+
sources.map(({ SubModel, ...ctx }) =>
291+
typeof SubModel.getShinyStats === 'function'
292+
? SubModel.getShinyStats(perms, args, ctx)
293+
: Promise.resolve(null),
294+
),
295+
)
296+
return results.find(Boolean) || null
297+
},
272298
portals: (_, args, { perms, Db }) => {
273299
if (perms?.portals) {
274300
return Db.query('Portal', 'getAll', perms, args)

server/src/graphql/typeDefs/index.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ type Query {
5050
filters: JSON
5151
): [Pokemon]
5252
pokemonSingle(id: ID, perm: String): Pokemon
53+
pokemonShinyStats(pokemon_id: Int!, form: Int): PokemonShinyStats
5354
portals(
5455
minLat: Float
5556
maxLat: Float

0 commit comments

Comments
 (0)