Skip to content

Commit be8ae26

Browse files
authored
Merge pull request #410 from WatWowMap/develop
Develop => Main
2 parents 54e507a + 3db914d commit be8ae26

103 files changed

Lines changed: 1822 additions & 4464 deletions

File tree

Some content is hidden

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

.babelrc

Lines changed: 0 additions & 12 deletions
This file was deleted.

.eslintrc

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
{
22
"extends": [
3-
"airbnb-base",
4-
"airbnb/rules/react"
3+
"airbnb",
4+
"airbnb/rules/react",
5+
"eslint:recommended"
56
],
6-
"parser": "@babel/eslint-parser",
7+
"parserOptions": {
8+
"ecmaVersion": "latest"
9+
},
710
"env": {
811
"browser": true,
9-
"jest": true
12+
"jest": true,
13+
"node": true
1014
},
1115
"globals": {
1216
"document": true,
13-
"window": true
17+
"window": true,
18+
"inject": true
1419
},
1520
"rules": {
1621
"linebreak-style": 0,
@@ -21,11 +26,15 @@
2126
"allowForLoopAfterthoughts": 0,
2227
"radix": 0,
2328
"eqeqeq": 0,
29+
"jsx-a11y/aria-role": 0,
2430
"consistent-return": 0,
2531
"no-use-before-define": 0,
2632
"no-param-reassign": 0,
2733
"arrow-parens": 0,
2834
"react/jsx-one-expression-per-line": 0,
35+
"jsx-a11y/no-noninteractive-element-interactions": 0,
36+
"jsx-a11y/click-events-have-key-events": 0,
37+
"react/function-component-definition": 0,
2938
"no-underscore-dangle": 0,
3039
"no-return-assign": 0,
3140
"max-len": [
@@ -59,6 +68,7 @@
5968
"settings": {
6069
"node": {
6170
"extensions": [
71+
".mjs",
6272
".js",
6373
".jsx",
6474
".ts",
@@ -90,6 +100,7 @@
90100
]
91101
],
92102
"extensions": [
103+
".mjs",
93104
".js",
94105
".jsx",
95106
".ts",

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,3 @@ Desktop.ini
5959
# Linux
6060
.directory
6161
*~
62-
63-
# VS Code
64-
/.vscode/

.stylelintrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"recommendations": [
3+
"streetsidesoftware.code-spell-checker",
4+
"dbaeumer.vscode-eslint",
5+
"lokalise.i18n-ally",
6+
"esbenp.prettier-vscode",
7+
"leizongmin.node-module-intellisense",
8+
"eg2.vscode-npm-script",
9+
"2gua.rainbow-brackets"
10+
]
11+
}

.vscode/settings.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"i18n-ally.localesPaths": [
3+
"public/base-locales"
4+
],
5+
"i18n-ally.keystyle": "flat",
6+
"[typescript]": {
7+
"editor.autoClosingBrackets": "always",
8+
"editor.defaultFormatter": "vscode.typescript-language-features"
9+
},
10+
"[typescriptreact]": {
11+
"editor.defaultFormatter": "vscode.typescript-language-features"
12+
},
13+
"[javascript]": {
14+
"editor.autoClosingBrackets": "always",
15+
"editor.defaultFormatter": "vscode.typescript-language-features"
16+
},
17+
"[javascriptreact]": {
18+
"editor.autoClosingBrackets": "always",
19+
"editor.defaultFormatter": "vscode.typescript-language-features"
20+
},
21+
}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# - mount areas.json to /home/node/server/src/configs/areas.json
66
# - Also mount every other configuration file necessary into the according directory.
77

8-
FROM node:14-alpine
8+
FROM node:16-alpine
99

1010
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
1111
ENV PATH=$PATH:/home/node/.npm-global/bin

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# ReactMap
2+
23
[![GitHub Release](https://img.shields.io/github/release/WatWowMap/ReactMap.svg)](https://github.com/WatWowMap/ReactMap/releases/)
34
[![GitHub Contributors](https://img.shields.io/github/contributors/WatWowMap/ReactMap.svg)](https://github.com/WatWowMap/ReactMap/graphs/contributors/)
4-
[![Discord](https://img.shields.io/discord/552003258000998401.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/zZ9h9Xa)
5+
[![Discord](https://img.shields.io/discord/552003258000998401.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/zZ9h9Xa)
6+
57
## Description
68

79
Pokemon GO Map frontend built with React.
@@ -21,6 +23,7 @@ Pokemon GO Map frontend built with React.
2123
- Discord Auth & Permission Based Viewing
2224

2325
## Live Demo
26+
2427
- You can find a live demo version of this app [here](https://www.reactmap.dev/).
2528
- To get the full experience you will need to have a Discord account
2629

@@ -31,13 +34,14 @@ Pokemon GO Map frontend built with React.
3134
- Or MariaDB (10.4 has been tested)
3235
- Yarn (npm install -g yarn)
3336

34-
## Backends Supported:
37+
## Backends Supported
3538

3639
- [Chuck](https://github.com/WatWowMap/Chuck)
3740
- [RealDeviceMap (RDM)](https://github.com/realdevicemap/realdevicemap)
3841
- [Map-A-Droid (MAD)](https://github.com/Map-A-Droid/MAD)
3942

4043
## Installation Instructions & More
44+
4145
- Check out the [Wiki](https://github.com/WatWowMap/ReactMap/wiki)!
4246

4347
## Credits

docker-compose.example.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '3.1'
1+
version: '3.7'
22
services:
33
reactmap:
44
image: ghcr.io/watwowmap/reactmap:main
@@ -8,6 +8,9 @@ services:
88
volumes:
99
- ./server/src/configs/areas.json:/home/node/server/src/configs/areas.json
1010
- ./server/src/configs/local.json:/home/node/server/src/configs/local.json
11+
- ./server/src/configs/geofence.json/:/home/node/server/src/configs/geofence.json
1112
- ./example.env:/home/node/.env
13+
security_opt:
14+
- no-new-privileges:true #https://nodramadevops.com/2019/06/running-docker-application-containers-more-securely/
1215
ports:
1316
- "9090:8080"

esbuild.config.mjs

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/* eslint-disable import/no-extraneous-dependencies */
2+
/* eslint-disable no-console */
3+
import path from 'path'
4+
import fs from 'fs'
5+
import { fileURLToPath } from 'url'
6+
import dotenv from 'dotenv'
7+
8+
import { build } from 'esbuild'
9+
import { htmlPlugin } from '@craftamap/esbuild-plugin-html'
10+
import esbuildMxnCopy from 'esbuild-plugin-mxn-copy'
11+
import aliasPlugin from 'esbuild-plugin-path-alias'
12+
import { eslintPlugin } from 'esbuild-plugin-eslinter'
13+
14+
const env = fs.existsSync('.env') ? dotenv.config() : { parsed: {} }
15+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
16+
const { version } = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.json')))
17+
const isDevelopment = Boolean(process.argv.includes('--dev'))
18+
const isRelease = Boolean(process.argv.includes('--release'))
19+
20+
if (fs.existsSync(path.resolve(__dirname, 'dist'))) {
21+
console.log('Cleaning up old build')
22+
fs.rm(path.resolve(__dirname, 'dist'), { recursive: true }, (err) => {
23+
if (err) console.log(err)
24+
})
25+
}
26+
27+
const plugins = [
28+
htmlPlugin({
29+
files: [
30+
{
31+
entryPoints: ['src/index.jsx'],
32+
filename: 'index.html',
33+
htmlTemplate: fs.readFileSync('./public/index.template.html'),
34+
scriptLoading: 'defer',
35+
favicon: './public/favicon/favicon.ico',
36+
},
37+
],
38+
}),
39+
esbuildMxnCopy({
40+
copy: [
41+
{ from: 'public/images', to: 'dist/' },
42+
{ from: 'public/locales', to: 'dist/' },
43+
],
44+
}),
45+
aliasPlugin({
46+
'@components': path.resolve(__dirname, './src/components'),
47+
'@assets': path.resolve(__dirname, './src/assets'),
48+
'@hooks': path.resolve(__dirname, './src/hooks'),
49+
'@services': path.resolve(__dirname, './src/services'),
50+
}),
51+
]
52+
53+
if (isDevelopment) {
54+
plugins.push(
55+
eslintPlugin(),
56+
)
57+
} else {
58+
console.log(`Building production version: ${version}`)
59+
}
60+
61+
try {
62+
await build({
63+
entryPoints: ['src/index.jsx'],
64+
legalComments: 'none',
65+
bundle: true,
66+
outdir: 'dist/',
67+
publicPath: '/',
68+
entryNames: isDevelopment ? undefined : '[name].[hash]',
69+
metafile: true,
70+
minify: isRelease || !isDevelopment,
71+
logLevel: isDevelopment ? 'info' : 'error',
72+
watch: isDevelopment
73+
? {
74+
onRebuild(error) {
75+
if (error) console.error('Recompiling failed:', error)
76+
else console.log('Recompiled successfully')
77+
},
78+
}
79+
: false,
80+
sourcemap: isRelease || isDevelopment,
81+
define: {
82+
inject: JSON.stringify({
83+
...env.parsed,
84+
VERSION: version,
85+
DEVELOPMENT: isDevelopment,
86+
}),
87+
},
88+
plugins,
89+
})
90+
} catch (e) {
91+
console.error(e)
92+
process.exit(1)
93+
} finally {
94+
console.log('React Map Compiled')
95+
}

0 commit comments

Comments
 (0)