Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7f856cd
chore(deps-dev): bump vite from 6.3.5 to 6.3.6
dependabot[bot] Sep 10, 2025
368954d
Merge pull request #1128 from WatWowMap/dependabot/npm_and_yarn/vite-…
Mygod Sep 10, 2025
72b0a8c
fix: relative timer not updating
Mygod Sep 15, 2025
d60f799
chore(release): v1.38.1-develop.1 [skip ci]
semantic-release-bot Sep 15, 2025
4ac76d0
feat: route share code
Mygod Sep 16, 2025
b39fe04
chore(release): v1.39.0-develop.1 [skip ci]
semantic-release-bot Sep 16, 2025
b0cfe13
fix: skip updated filtering if shortcode is present
Mygod Sep 16, 2025
d8019f3
chore(release): v1.39.0-develop.2 [skip ci]
semantic-release-bot Sep 16, 2025
ba51f47
feat: display actual battle bonus via stationed pokemon
Mygod Sep 22, 2025
2b83a26
chore(release): v1.39.0-develop.3 [skip ci]
semantic-release-bot Sep 22, 2025
9144e54
chore: new AGENTS.md
Mygod Sep 23, 2025
795976e
feat: Compact Route View (#1131)
Mygod Sep 23, 2025
7a832cd
chore(release): v1.39.0-develop.4 [skip ci]
semantic-release-bot Sep 23, 2025
8c0ba37
fix: refinements to interaction between gyms/stops and routes
Mygod Sep 23, 2025
f02e8cd
fix: localization
Mygod Sep 23, 2025
7b851bb
chore(release): v1.39.0-develop.5 [skip ci]
semantic-release-bot Sep 23, 2025
5a02a6b
fix: translation
Mygod Sep 23, 2025
f457d51
chore(release): v1.39.0-develop.6 [skip ci]
semantic-release-bot Sep 23, 2025
d44a3df
feat: estimated shiny probability for pokemon (#1133)
Mygod Sep 24, 2025
916b35f
chore(release): v1.39.0-develop.7 [skip ci]
semantic-release-bot Sep 24, 2025
2fe3af3
fix: ditto filtering
Mygod Sep 24, 2025
5490c12
chore(release): v1.39.0-develop.8 [skip ci]
semantic-release-bot Sep 24, 2025
51c3c35
chore: remove unused ditto_form
Mygod Sep 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Repository Guidelines

## Project Structure & Module Organization

- 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`.
- 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`.
- 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.
- Static assets are sourced from `public/`, while built bundles land in `dist/`; avoid committing build artefacts or anything listed in `.gitignore`.

## Build, Test, and Development Commands

- `yarn install` – install workspace dependencies; rerun after pulling lockfile changes.
- `yarn dev` – start the full dev stack (Nodemon backend + Vite) using local config.
- `yarn watch` – Vite-only hot reload for rapid UI work when the API is proxied elsewhere.
- `yarn build` – create a production bundle in `dist/`; ensure it succeeds before release PRs.
- `yarn lint` / `yarn lint:fix` – run ESLint with the Airbnb ruleset; lint must pass pre-commit.
- `yarn prettier` / `yarn prettier:fix` – enforce formatting for JS/JSX, CSS, HTML, and YAML.
- `yarn config:env` and `yarn locales:generate` – regenerate env files and derived locales after editing base config or strings.

## Coding Style & Naming Conventions

- Prettier governs formatting (2-space indent, single quotes in JS, semicolons off); never hand-format conflicting styles.
- Prefer functional React components, PascalCase for components, camelCase for helpers, and `use` prefixes for hooks.

## Testing Guidelines

- No dedicated Jest suite today; rely on `yarn lint`, type checks from editor tooling, and manual verification in a local dev session.
- When adding backend features, exercise relevant GraphQL/REST paths via the dev server and document sanity checks in the PR description.

## Commit & Pull Request Guidelines

- Use Conventional Commits (`type(scope): summary`), matching existing history (e.g. `feat(map): add weather overlays`).
- Each PR should describe scope, link related issues, list testing steps, and include screenshots or GIFs for UI changes.
- Re-run `yarn lint`, `yarn build`, and integration steps touched by the change before requesting review.

## Localization Notes

- Update English copy only in `packages/locales/lib/human/en.json`; run `yarn locales:generate` to refresh derived languages.
- 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.
- Never edit generated locale files directly—the automation pipeline syncs translations downstream.
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
# [1.39.0-develop.8](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.7...v1.39.0-develop.8) (2025-09-24)


### Bug Fixes

* ditto filtering ([2fe3af3](https://github.com/WatWowMap/ReactMap/commit/2fe3af358bd848810e8d63b3b7e442f70ad78da7))

# [1.39.0-develop.7](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.6...v1.39.0-develop.7) (2025-09-24)


### Features

* estimated shiny probability for pokemon ([#1133](https://github.com/WatWowMap/ReactMap/issues/1133)) ([d44a3df](https://github.com/WatWowMap/ReactMap/commit/d44a3df6834e3752a129a2fa5706526076cd9144))

# [1.39.0-develop.6](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.5...v1.39.0-develop.6) (2025-09-23)


### Bug Fixes

* translation ([5a02a6b](https://github.com/WatWowMap/ReactMap/commit/5a02a6b81ca3c559dd2fea41a0b4c5a382560ed1))

# [1.39.0-develop.5](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.4...v1.39.0-develop.5) (2025-09-23)


### Bug Fixes

* localization ([f02e8cd](https://github.com/WatWowMap/ReactMap/commit/f02e8cd927d76c9191e7fe6ea909f6eec9a4a729))
* refinements to interaction between gyms/stops and routes ([8c0ba37](https://github.com/WatWowMap/ReactMap/commit/8c0ba372db29e53f2b74215494a8b170feab192a))

# [1.39.0-develop.4](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.3...v1.39.0-develop.4) (2025-09-23)


### Features

* Compact Route View ([#1131](https://github.com/WatWowMap/ReactMap/issues/1131)) ([795976e](https://github.com/WatWowMap/ReactMap/commit/795976e2ea9f68ba54ad5495bbf81af2716b4920))

# [1.39.0-develop.3](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.2...v1.39.0-develop.3) (2025-09-22)


### Features

* display actual battle bonus via stationed pokemon ([ba51f47](https://github.com/WatWowMap/ReactMap/commit/ba51f47d6c90dc659427148d4cc025ed6bc89950))

# [1.39.0-develop.2](https://github.com/WatWowMap/ReactMap/compare/v1.39.0-develop.1...v1.39.0-develop.2) (2025-09-16)


### Bug Fixes

* skip updated filtering if shortcode is present ([b0cfe13](https://github.com/WatWowMap/ReactMap/commit/b0cfe13876b9d81e70ce44c997f4accb48943609))

# [1.39.0-develop.1](https://github.com/WatWowMap/ReactMap/compare/v1.38.1-develop.1...v1.39.0-develop.1) (2025-09-16)


### Features

* route share code ([4ac76d0](https://github.com/WatWowMap/ReactMap/commit/4ac76d00d53eb06966a94a525541302340b638de))

## [1.38.1-develop.1](https://github.com/WatWowMap/ReactMap/compare/v1.38.0...v1.38.1-develop.1) (2025-09-15)


### Bug Fixes

* relative timer not updating ([72b0a8c](https://github.com/WatWowMap/ReactMap/commit/72b0a8cfb3fab2ce897b02e8517bb9c324d0cc80))

# [1.38.0](https://github.com/WatWowMap/ReactMap/compare/v1.37.0...v1.38.0) (2025-09-10)


Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reactmap",
"version": "1.38.0",
"version": "1.39.0-develop.8",
"private": true,
"description": "React based frontend map.",
"license": "MIT",
Expand Down Expand Up @@ -149,6 +149,7 @@
"i18next-http-backend": "2.5.2",
"knex": "3.1.0",
"leaflet": "1.9.4",
"leaflet-arrowheads": "^1.4.0",
"leaflet.locatecontrol": "0.81.0",
"lodash": "^4.17.21",
"moment-timezone": "^0.5.43",
Expand Down
9 changes: 8 additions & 1 deletion packages/locales/lib/human/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@
"with_ar": "With AR",
"both": "Both",
"without_ar": "Without AR",
"shiny_probability": "Shiny probability: <0/>",
"shiny_probability": "Shiny rate: <0/>",
"shiny_sample": "{{percentage}}%: {{shiny}} shiny/{{checks}} checks since {{date}}",
"exclude_quest_multi": "Exclude {{reward}}",
"cluster_limit_0": "{{variable_0}} limit ({{variable_1}}) has been hit",
"cluster_limit_1": "Please zoom in or narrow your filters",
Expand Down Expand Up @@ -660,7 +661,13 @@
"version": "Version",
"route_tags": "Route Tags",
"routes": "Routes",
"compact_route_view": "Compact Route View",
"route_type": "Route Type",
"route_short_code": "Route Share Code: ",
"route_anchor_count_one": "{{count}} Route",
"route_anchor_count_other": "{{count}} Routes",
"shortcode_copied_to_clipboard": "Code copied to clipboard!",
"copy_failed": "Copy failed",
"routes_subtitle": "View in game routes and relevant information about them on the map",
"description": "Description",
"additional_info": "Additional Info",
Expand Down
7 changes: 6 additions & 1 deletion packages/types/lib/scanner.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export interface PokemonDisplay {
location_card: number
}

export interface PokemonShinyStats {
shiny_seen: number
encounters_seen: number
since_date?: string
}

export interface Defender extends PokemonDisplay {
pokemon_id: number
deployed_ms: number
Expand Down Expand Up @@ -223,7 +229,6 @@ export interface Pokemon {
costume: number
gender: Gender
display_pokemon_id: number
ditto_form: number
weight: number
height: number
size: number
Expand Down
2 changes: 2 additions & 0 deletions packages/types/lib/server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export interface DbContext {
hasShowcaseForm: boolean
hasShowcaseType: boolean
hasStationedGmax: boolean
hasPokemonShinyStats?: boolean
connection?: number
}

export interface ExpressUser extends User {
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@rm/logger": "*"
},
"devDependencies": {
"vite": "^6.2.6"
"vite": "^6.3.6"
}
}
7 changes: 0 additions & 7 deletions server/src/filters/pokemon/Backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,16 +430,9 @@ class PkmnBackend {
expire_timestamp_verified: !!pokemon.expire_timestamp_verified,
updated: pokemon.updated,
display_pokemon_id: pokemon.display_pokemon_id,
ditto_form: pokemon.ditto_form,
seen_type: pokemon.seen_type,
changed: !!pokemon.changed,
}
if (result.pokemon_id === 132 && !result.ditto_form) {
result.ditto_form = result.form
result.form =
state.event.masterfile.pokemon[result.display_pokemon_id]
?.defaultFormId || 0
}
if (!result.seen_type) {
if (result.spawn_id === null) {
result.seen_type = result.pokestop_id ? 'nearby_stop' : 'nearby_cell'
Expand Down
26 changes: 26 additions & 0 deletions server/src/graphql/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ const resolvers = {
JSON: GraphQLJSON,
Query: {
available: (_, _args, { Event, Db, perms }) => {
const supportsShinyStats = Array.isArray(Db.models?.Pokemon)
? Db.models.Pokemon.some(({ SubModel, ...ctx }) =>
typeof SubModel.supportsShinyStats === 'function'
? SubModel.supportsShinyStats(ctx)
: false,
)
: false

const data = {
questConditions: perms.quests ? Db.questConditions : {},
masterfile: { ...Event.masterfile, invasions: Event.invasions },
Expand All @@ -36,6 +44,7 @@ const resolvers = {
...config.getSafe('icons'),
styles: Event.uicons,
},
supportsShinyStats,
}
return data
},
Expand Down Expand Up @@ -269,6 +278,23 @@ const resolvers = {
}
return {}
},
pokemonShinyStats: async (_, args, { perms, Db }) => {
if (!perms?.pokemon) {
return null
}
const sources = Db.models?.Pokemon
if (!Array.isArray(sources)) {
return null
}
const results = await Promise.all(
sources.map(({ SubModel, ...ctx }) =>
typeof SubModel.getShinyStats === 'function'
? SubModel.getShinyStats(perms, args, ctx)
: Promise.resolve(null),
),
)
return results.find(Boolean) || null
},
portals: (_, args, { perms, Db }) => {
if (perms?.portals) {
return Db.query('Portal', 'getAll', perms, args)
Expand Down
1 change: 1 addition & 0 deletions server/src/graphql/typeDefs/index.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type Query {
filters: JSON
): [Pokemon]
pokemonSingle(id: ID, perm: String): Pokemon
pokemonShinyStats(pokemon_id: Int!, form: Int): PokemonShinyStats
portals(
minLat: Float
maxLat: Float
Expand Down
1 change: 1 addition & 0 deletions server/src/graphql/typeDefs/map.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ type MapData {
questConditions: JSON
icons: JSON
audio: JSON
supportsShinyStats: Boolean
}

type Badge {
Expand Down
8 changes: 7 additions & 1 deletion server/src/graphql/typeDefs/scanner.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ type Pokestop {
hasShowcase: Boolean
}

type PokemonShinyStats {
shiny_seen: Int
encounters_seen: Int
since_date: String
}

type Pokemon {
id: ID
encounter_id: Int
Expand All @@ -159,7 +165,6 @@ type Pokemon {
costume: Int
gender: Int
display_pokemon_id: Int
ditto_form: Int
weight: Float
height: Float
size: Float
Expand Down Expand Up @@ -246,6 +251,7 @@ type Waypoint {
type Route {
id: ID
name: String
shortcode: String
description: String
distance_meters: Int
duration_seconds: Int
Expand Down
Loading
Loading