Skip to content

Commit b3efaab

Browse files
authored
Merge pull request #441 from WatWowMap/develop
Sync Develop
2 parents 366f504 + e95d7b4 commit b3efaab

63 files changed

Lines changed: 1891 additions & 358 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,8 @@ Desktop.ini
5959
# Linux
6060
.directory
6161
*~
62+
63+
# Custom Files
64+
src/**/*.custom.jsx
65+
src/**/*.custom.js
66+
src/**/*.custom.css

esbuild.config.mjs

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
/* eslint-disable no-await-in-loop */
2+
/* eslint-disable no-continue */
3+
/* eslint-disable no-restricted-syntax */
14
/* eslint-disable import/no-extraneous-dependencies */
25
/* eslint-disable no-console */
36
import path from 'path'
47
import fs from 'fs'
58
import { fileURLToPath } from 'url'
69
import dotenv from 'dotenv'
710

8-
import { build } from 'esbuild'
11+
import { build as compile } from 'esbuild'
912
import { htmlPlugin } from '@craftamap/esbuild-plugin-html'
1013
import esbuildMxnCopy from 'esbuild-plugin-mxn-copy'
1114
import aliasPlugin from 'esbuild-plugin-path-alias'
@@ -17,9 +20,19 @@ const { version } = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.
1720
const isDevelopment = Boolean(process.argv.includes('--dev'))
1821
const isRelease = Boolean(process.argv.includes('--release'))
1922

20-
if (fs.existsSync(path.resolve(__dirname, 'dist'))) {
23+
const hasCustom = await (async function checkFolders(folder, isCustom = false) {
24+
for (const file of await fs.promises.readdir(folder)) {
25+
if (isCustom) return true
26+
if (file.startsWith('.')) continue
27+
if (!file.includes('.')) isCustom = await checkFolders(`${folder}/${file}`, isCustom)
28+
if (/\.custom.(jsx?|css)$/.test(file)) return true
29+
}
30+
return isCustom
31+
}(path.resolve(__dirname, 'src')))
32+
33+
if (await fs.existsSync(path.resolve(__dirname, 'dist'))) {
2134
console.log('Cleaning up old build')
22-
fs.rm(path.resolve(__dirname, 'dist'), { recursive: true }, (err) => {
35+
await fs.rm(path.resolve(__dirname, 'dist'), { recursive: true }, (err) => {
2336
if (err) console.log(err)
2437
})
2538
}
@@ -30,7 +43,7 @@ const plugins = [
3043
{
3144
entryPoints: ['src/index.jsx'],
3245
filename: 'index.html',
33-
htmlTemplate: fs.readFileSync('./public/index.template.html'),
46+
htmlTemplate: await fs.readFileSync('./public/index.template.html'),
3447
scriptLoading: 'defer',
3548
favicon: './public/favicon/favicon.ico',
3649
},
@@ -55,11 +68,50 @@ if (isDevelopment) {
5568
eslintPlugin(),
5669
)
5770
} else {
71+
if (hasCustom) {
72+
plugins.push(
73+
{
74+
name: 'Custom Loader',
75+
setup(build) {
76+
const customPaths = []
77+
build.onLoad({ filter: /\.(jsx?|css)$/ }, async (args) => {
78+
const isNodeModule = /node_modules/.test(args.path)
79+
if (!isNodeModule) {
80+
const [base, suffix] = args.path.split('.')
81+
const newPath = `${base}.custom.${suffix}`
82+
if (await fs.existsSync(newPath)) {
83+
customPaths.push(newPath)
84+
return {
85+
contents: await fs.readFileSync(newPath, 'utf8'),
86+
loader: suffix,
87+
watchFiles: isDevelopment ? [newPath] : undefined,
88+
}
89+
}
90+
}
91+
})
92+
build.onEnd(() => {
93+
if (customPaths.length && !isDevelopment) {
94+
console.log(`
95+
======================================================
96+
WARNING:
97+
Custom files aren't officially supported
98+
Be sure to watch for breaking changes!
99+
100+
${customPaths.map((x, i) => ` ${i + 1}. src/${x.split('src/')[1]}`).join('\n')}
101+
102+
======================================================
103+
`)
104+
}
105+
})
106+
},
107+
},
108+
)
109+
}
58110
console.log(`Building production version: ${version}`)
59111
}
60112

61113
try {
62-
await build({
114+
await compile({
63115
entryPoints: ['src/index.jsx'],
64116
legalComments: 'none',
65117
bundle: true,
@@ -89,6 +141,8 @@ try {
89141
...env.parsed,
90142
VERSION: version,
91143
DEVELOPMENT: isDevelopment,
144+
CUSTOM: hasCustom,
145+
LOCALES: await fs.promises.readdir(`${__dirname}/public/locales`),
92146
}),
93147
},
94148
plugins,

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@sentry/cli": "^1.73.0",
3333
"dotenv": "^10.0.0",
3434
"esbuild": "^0.14.22",
35-
"esbuild-plugin-eslinter": "^0.1.1",
35+
"esbuild-plugin-eslinter": "^0.1.2",
3636
"esbuild-plugin-mxn-copy": "^1.0.1",
3737
"esbuild-plugin-path-alias": "^1.0.3",
3838
"eslint": "^8.9.0",
@@ -50,9 +50,12 @@
5050
"@material-ui/icons": "^4.11.2",
5151
"@material-ui/lab": "^4.0.0-alpha.60",
5252
"@material-ui/styles": "^4.11.4",
53-
"@sentry/react": "^6.16.1",
54-
"@sentry/tracing": "^6.16.1",
53+
"@sentry/react": "^6.18.2",
54+
"@sentry/tracing": "^6.18.2",
55+
"@turf/boolean-point-in-polygon": "^6.5.0",
5556
"@turf/center": "^6.3.0",
57+
"@turf/destination": "^6.5.0",
58+
"@turf/helpers": "^6.5.0",
5659
"apollo-link-timeout": "^4.0.0",
5760
"apollo-server-core": "^3.5.0",
5861
"apollo-server-express": "^3.5.0",

public/base-locales/de.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,5 +489,31 @@
489489
"loading": "laden von {{category}}",
490490
"loading_icons": "Icons abrufen",
491491
"loading_invasions": "Rocket-Lineup abrufen",
492-
"pvp_ranking_cap": "Level"
492+
"pvp_ranking_cap": "Level",
493+
"scan_next": "Standort scannen",
494+
"scan_next_choose": "Ziehen Sie die Markierung per Drag & Drop um die Scanposition festzulegen",
495+
"scan_zone": "Scanne ein Gebiet",
496+
"scan_zone_choose": "Ziehen Sie die Markierung per Drag & Drop um die Scanposition festzulegen und die Größe zu wählen",
497+
"scan_zone_size": "Größe",
498+
"scan_zone_range": "Reichweite",
499+
"scan_zone_spacing": "Abstand",
500+
"scan_zone_radius": "Radius",
501+
"scan_requests": "Scan Anfrage",
502+
"scan_queue": "Aktuelle Warteschlange",
503+
"click_to_scan": "Hier scannen",
504+
"scan_confirmed_title": "Scan-Anfrage bestätigt",
505+
"scan_confirmed": "Gerät wurde an den Standort geschickt, das Ergebnis wird bald auf der Karte erscheinen!",
506+
"scan_loading_title": "Sende Scan-Anfrage",
507+
"scan_loading": "Deine Scan-Anfrage wird bearbeitet und wurde erfolgreich abgeschickt!",
508+
"scan_error_title": "Fehler",
509+
"scan_error": "Es ist ein Fehler bei der Verarbeitung der Scan-Anfrage aufgetreten...",
510+
"scan_outside_area": "Dieser Standort liegt außerhalb der Grenzen der zugelassenen Gebiete",
511+
"device_icons": "Gerätesymbole",
512+
"spawnpoint_icons": "Spawnpunkt-Symbole",
513+
"disabled": "Deaktiviert",
514+
"lc_title": "folge deinem Standort",
515+
"lc_metersUnit": "Meter",
516+
"lc_feetUnit": "Fuss",
517+
"lc_popup": "Dein Standort befindet sich innerhalb von {distance} {unit} Abstand zu diesem Punkt.",
518+
"lc_outsideMapBoundsMsg": "Dein Standort scheint sich außerhalb der Grenzen der Karte zu befinden."
493519
}

public/base-locales/en.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
"search_nests": "Search Nests",
2222
"search_gyms": "Search Gyms",
2323
"search_pokestops": "Search PokéStops",
24+
"search_raids": "Search Raids",
25+
"search_eggs": "Search Eggs",
26+
"search_quests": "Search Quests",
27+
"search_lures": "Search Lures",
28+
"search_invasions": "Search Invasions",
2429
"sm": "sm",
2530
"md": "md",
2631
"lg": "lg",
@@ -493,5 +498,29 @@
493498
"loading": "Loading {{category}}",
494499
"loading_icons": "Fetching Icons",
495500
"loading_invasions": "Fetching Invasions",
496-
"pvp_ranking_cap": "Level"
501+
"scan_next": "Scan Location",
502+
"scan_next_choose": "Drag and Drop the Marker to Set the Scan Location",
503+
"scan_zone": "Scan an Area",
504+
"scan_zone_choose": "Drag and Drop the Marker to Set the Scan Location and Choose the Size",
505+
"scan_zone_size": "Size",
506+
"scan_zone_range": "Range",
507+
"scan_zone_spacing": "Spacing",
508+
"scan_zone_radius": "Radius",
509+
"scan_requests": "Scan Requests",
510+
"scan_queue": "Current Queue",
511+
"click_to_scan": "Scan Here",
512+
"scan_confirmed_title": "Scan demand confirmed",
513+
"scan_confirmed": "Worker has been sent to location, result will soon appear on the map!",
514+
"scan_loading_title": "Sending scan request",
515+
"scan_loading": "Your scan request is being processed and sent to the system!",
516+
"scan_error_title": "Error",
517+
"scan_error": "There has been an error while processing the scan request...",
518+
"scan_outside_area": "This location is outside the boundaries of authorized areas",
519+
"pvp_ranking_cap": "Level",
520+
"lc_title": "Follow Your Location",
521+
"lc_metersUnit": "meters",
522+
"lc_feetUnit": "feet",
523+
"lc_popup": "You are within {distance} {unit} from this point",
524+
"lc_outsideMapBoundsMsg": "You seem located outside the boundaries of the map",
525+
"no_alerts": "No Alerts Found"
497526
}

public/base-locales/es.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,5 +469,20 @@
469469
"loading_icons": "Obtener iconos",
470470
"loading_invasions": "Ir a buscar invasiones",
471471
"loading": "Cargando {{category}}",
472-
"pvp_ranking_cap": "Nivel"
472+
"pvp_ranking_cap": "Nivel",
473+
"badge_0": "Ninguna",
474+
"device_icons": "Iconos de dispositivos",
475+
"spawnpoint_icons": "Iconos de puntos de aparición",
476+
"badge_1": "Bronce",
477+
"badge_2": "Plata",
478+
"badge_3": "Oro",
479+
"gym_badge_menu": "Editar insignia de gimnasio",
480+
"gym_badges": "insignias de gimnasio",
481+
"gym_badge_diamonds": "Mostrar insignias de gimnasio",
482+
"gym_badges_subtitle": "Muestra insignias de gimnasio en el mapa y una lista en la página de perfil.",
483+
"confirm_filters_reset": "Restablecer filtros",
484+
"filters_reset_text": "¿Está seguro de que desea restablecer la configuración a los valores predeterminados? \n¡Esto no se puede deshacer!",
485+
"filters_reset_title": "Restablecer filtros",
486+
"raid_quick_select": "Selección rápida",
487+
"disabled": "Discapacitado"
473488
}

public/base-locales/fr.json

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,5 +484,30 @@
484484
"loading_invasions": "Récupération des Invasions",
485485
"login_button": 12,
486486
"join_button": 12,
487-
"pvp_ranking_cap": "Niveau"
488-
}
487+
"scan_next": "Scanner un emplacement",
488+
"scan_next_choose": "Glisser et déposer le marqueur pour définir l'emplacement de scan",
489+
"scan_zone": "Scanner une zone",
490+
"scan_zone_choose": "Glisser et déposer le marqueur pour définir l'emplacement et choisissez la taille du scan",
491+
"scan_zone_size": "Taille",
492+
"scan_zone_range": "Portée",
493+
"scan_zone_spacing": "Espacement",
494+
"scan_zone_radius": "Rayon",
495+
"scan_requests": "Demandes de Scan ",
496+
"scan_queue": "File d'attente ",
497+
"click_to_scan": "Scanner ici",
498+
"scan_confirmed_title": "Demande de scan confirmée",
499+
"scan_confirmed": "L'appareil a été envoyé à la position de scan, le résultat sera bientôt visible sur la map !",
500+
"scan_loading_title": "Envoi de la demande de scan",
501+
"scan_loading": "Votre demande de scan est analysée et transmise au système !",
502+
"scan_error_title": "Erreur",
503+
"scan_error": "Il y a eu une erreur lors du traitement de la demande de scan...",
504+
"scan_outside_area": "Cet emplacement est en dehors des zones autorisées",
505+
"pvp_ranking_cap": "Niveau",
506+
"device_icons": "Icônes d'appareils",
507+
"spawnpoint_icons": "Icônes de points d'apparition",
508+
"confirm_filters_reset": "Réinitialiser les filtres",
509+
"filters_reset_text": "Voulez-vous vraiment réinitialiser les paramètres aux valeurs par défaut ? \nCelà ne peut pas être annulé!",
510+
"filters_reset_title": "Réinitialiser les filtres",
511+
"raid_quick_select": "Sélection rapide",
512+
"disabled": "Désactivé"
513+
}

public/base-locales/it.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,5 +438,20 @@
438438
"loading_icons": "Recupero delle icone",
439439
"loading_invasions": "Recupero delle invasioni",
440440
"loading": "Caricamento {{category}}",
441-
"pvp_ranking_cap": "Livello"
441+
"pvp_ranking_cap": "Livello",
442+
"badge_0": "Nessuno",
443+
"device_icons": "Icone del dispositivo",
444+
"spawnpoint_icons": "Icone del punto di spawn",
445+
"badge_1": "Bronzo",
446+
"badge_2": "Argento",
447+
"badge_3": "Oro",
448+
"gym_badge_menu": "Modifica badge palestra",
449+
"gym_badges": "Distintivi da palestra",
450+
"gym_badge_diamonds": "Mostra badge palestra",
451+
"gym_badges_subtitle": "Visualizza i badge della palestra sulla mappa e un elenco nella pagina del profilo.",
452+
"confirm_filters_reset": "Ripristina i filtri",
453+
"filters_reset_text": "Sei sicuro di voler ripristinare le impostazioni ai valori predefiniti? \nQuesto non può essere annullato!",
454+
"filters_reset_title": "Ripristina i filtri",
455+
"raid_quick_select": "Selezione rapida",
456+
"disabled": "Disabilitato"
442457
}

public/base-locales/ja.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,5 +439,20 @@
439439
"loading_icons": "アイコンの取得",
440440
"loading_invasions": "侵略をフェッチする",
441441
"loading": "{{category}}を読み込んでいます",
442-
"pvp_ranking_cap": "レベル"
442+
"pvp_ranking_cap": "レベル",
443+
"badge_0": "なし",
444+
"device_icons": "デバイスアイコン",
445+
"spawnpoint_icons": "スポーンポイントアイコン",
446+
"badge_1": "ブロンズ",
447+
"badge_2": "",
448+
"badge_3": "ゴールド",
449+
"gym_badge_menu": "ジムバッジを編集する",
450+
"gym_badges": "ジムバッジ",
451+
"gym_badge_diamonds": "ジムバッジを表示する",
452+
"gym_badges_subtitle": "マップ上にジムバッジを表示し、プロファイルページにリストを表示します。",
453+
"confirm_filters_reset": "フィルタをリセット",
454+
"filters_reset_text": "設定をデフォルト値にリセットしてもよろしいですか?\nこれは、元に戻すことはできません!",
455+
"filters_reset_title": "フィルタをリセット",
456+
"raid_quick_select": "クイックセレクト",
457+
"disabled": "無効"
443458
}

public/base-locales/ko.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,5 +438,20 @@
438438
"loading_icons": "아이콘 가져오기",
439439
"loading_invasions": "침략 가져오기",
440440
"loading": "{{category}} 로드 중",
441-
"pvp_ranking_cap": "수준"
441+
"pvp_ranking_cap": "수준",
442+
"badge_0": "없음",
443+
"device_icons": "장치 아이콘",
444+
"spawnpoint_icons": "생성 지점 아이콘",
445+
"badge_1": "청동",
446+
"badge_2": "",
447+
"badge_3": "",
448+
"gym_badge_menu": "체육관 배지 수정",
449+
"gym_badges": "체육관 배지",
450+
"gym_badge_diamonds": "체육관 배지 표시",
451+
"gym_badges_subtitle": "지도에 체육관 배지를 표시하고 프로필 페이지에 목록을 표시합니다.",
452+
"confirm_filters_reset": "필터 재설정",
453+
"filters_reset_text": "설정을 기본값으로 재설정하시겠습니까? \n이 취소 할 수 없습니다!",
454+
"filters_reset_title": "필터 재설정",
455+
"raid_quick_select": "빠른 선택",
456+
"disabled": "장애가있는"
442457
}

0 commit comments

Comments
 (0)