Skip to content

Commit

Permalink
Merge pull request #410 from WatWowMap/develop
Browse files Browse the repository at this point in the history
Develop => Main
  • Loading branch information
TurtIeSocks authored Mar 2, 2022
2 parents 54e507a + 3db914d commit be8ae26
Show file tree
Hide file tree
Showing 103 changed files with 1,822 additions and 4,464 deletions.
12 changes: 0 additions & 12 deletions .babelrc

This file was deleted.

21 changes: 16 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{
"extends": [
"airbnb-base",
"airbnb/rules/react"
"airbnb",
"airbnb/rules/react",
"eslint:recommended"
],
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": "latest"
},
"env": {
"browser": true,
"jest": true
"jest": true,
"node": true
},
"globals": {
"document": true,
"window": true
"window": true,
"inject": true
},
"rules": {
"linebreak-style": 0,
Expand All @@ -21,11 +26,15 @@
"allowForLoopAfterthoughts": 0,
"radix": 0,
"eqeqeq": 0,
"jsx-a11y/aria-role": 0,
"consistent-return": 0,
"no-use-before-define": 0,
"no-param-reassign": 0,
"arrow-parens": 0,
"react/jsx-one-expression-per-line": 0,
"jsx-a11y/no-noninteractive-element-interactions": 0,
"jsx-a11y/click-events-have-key-events": 0,
"react/function-component-definition": 0,
"no-underscore-dangle": 0,
"no-return-assign": 0,
"max-len": [
Expand Down Expand Up @@ -59,6 +68,7 @@
"settings": {
"node": {
"extensions": [
".mjs",
".js",
".jsx",
".ts",
Expand Down Expand Up @@ -90,6 +100,7 @@
]
],
"extensions": [
".mjs",
".js",
".jsx",
".ts",
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,3 @@ Desktop.ini
# Linux
.directory
*~

# VS Code
/.vscode/
17 changes: 0 additions & 17 deletions .stylelintrc

This file was deleted.

11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recommendations": [
"streetsidesoftware.code-spell-checker",
"dbaeumer.vscode-eslint",
"lokalise.i18n-ally",
"esbenp.prettier-vscode",
"leizongmin.node-module-intellisense",
"eg2.vscode-npm-script",
"2gua.rainbow-brackets"
]
}
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"i18n-ally.localesPaths": [
"public/base-locales"
],
"i18n-ally.keystyle": "flat",
"[typescript]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[javascript]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[javascriptreact]": {
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "vscode.typescript-language-features"
},
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# - mount areas.json to /home/node/server/src/configs/areas.json
# - Also mount every other configuration file necessary into the according directory.

FROM node:14-alpine
FROM node:16-alpine

ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# ReactMap

[![GitHub Release](https://img.shields.io/github/release/WatWowMap/ReactMap.svg)](https://github.com/WatWowMap/ReactMap/releases/)
[![GitHub Contributors](https://img.shields.io/github/contributors/WatWowMap/ReactMap.svg)](https://github.com/WatWowMap/ReactMap/graphs/contributors/)
[![Discord](https://img.shields.io/discord/552003258000998401.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/zZ9h9Xa)
[![Discord](https://img.shields.io/discord/552003258000998401.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/zZ9h9Xa)

## Description

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

## Live Demo

- You can find a live demo version of this app [here](https://www.reactmap.dev/).
- To get the full experience you will need to have a Discord account

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

## Backends Supported:
## Backends Supported

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

## Installation Instructions & More

- Check out the [Wiki](https://github.com/WatWowMap/ReactMap/wiki)!

## Credits
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.example.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.1'
version: '3.7'
services:
reactmap:
image: ghcr.io/watwowmap/reactmap:main
Expand All @@ -8,6 +8,9 @@ services:
volumes:
- ./server/src/configs/areas.json:/home/node/server/src/configs/areas.json
- ./server/src/configs/local.json:/home/node/server/src/configs/local.json
- ./server/src/configs/geofence.json/:/home/node/server/src/configs/geofence.json
- ./example.env:/home/node/.env
security_opt:
- no-new-privileges:true #https://nodramadevops.com/2019/06/running-docker-application-containers-more-securely/
ports:
- "9090:8080"
95 changes: 95 additions & 0 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable no-console */
import path from 'path'
import fs from 'fs'
import { fileURLToPath } from 'url'
import dotenv from 'dotenv'

import { build } from 'esbuild'
import { htmlPlugin } from '@craftamap/esbuild-plugin-html'
import esbuildMxnCopy from 'esbuild-plugin-mxn-copy'
import aliasPlugin from 'esbuild-plugin-path-alias'
import { eslintPlugin } from 'esbuild-plugin-eslinter'

const env = fs.existsSync('.env') ? dotenv.config() : { parsed: {} }
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const { version } = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.json')))
const isDevelopment = Boolean(process.argv.includes('--dev'))
const isRelease = Boolean(process.argv.includes('--release'))

if (fs.existsSync(path.resolve(__dirname, 'dist'))) {
console.log('Cleaning up old build')
fs.rm(path.resolve(__dirname, 'dist'), { recursive: true }, (err) => {
if (err) console.log(err)
})
}

const plugins = [
htmlPlugin({
files: [
{
entryPoints: ['src/index.jsx'],
filename: 'index.html',
htmlTemplate: fs.readFileSync('./public/index.template.html'),
scriptLoading: 'defer',
favicon: './public/favicon/favicon.ico',
},
],
}),
esbuildMxnCopy({
copy: [
{ from: 'public/images', to: 'dist/' },
{ from: 'public/locales', to: 'dist/' },
],
}),
aliasPlugin({
'@components': path.resolve(__dirname, './src/components'),
'@assets': path.resolve(__dirname, './src/assets'),
'@hooks': path.resolve(__dirname, './src/hooks'),
'@services': path.resolve(__dirname, './src/services'),
}),
]

if (isDevelopment) {
plugins.push(
eslintPlugin(),
)
} else {
console.log(`Building production version: ${version}`)
}

try {
await build({
entryPoints: ['src/index.jsx'],
legalComments: 'none',
bundle: true,
outdir: 'dist/',
publicPath: '/',
entryNames: isDevelopment ? undefined : '[name].[hash]',
metafile: true,
minify: isRelease || !isDevelopment,
logLevel: isDevelopment ? 'info' : 'error',
watch: isDevelopment
? {
onRebuild(error) {
if (error) console.error('Recompiling failed:', error)
else console.log('Recompiled successfully')
},
}
: false,
sourcemap: isRelease || isDevelopment,
define: {
inject: JSON.stringify({
...env.parsed,
VERSION: version,
DEVELOPMENT: isDevelopment,
}),
},
plugins,
})
} catch (e) {
console.error(e)
process.exit(1)
} finally {
console.log('React Map Compiled')
}
65 changes: 24 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,48 @@
{
"name": "reactmap",
"version": "1.0.16",
"version": "1.1.0",
"description": "React based frontend map.",
"main": "index.js",
"author": "TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com>",
"license": "MIT",
"private": true,
"scripts": {
"start": "yarn create-locales && webpack --env prod && yarn generate && yarn migrate:latest && yarn server",
"server": "yarn generate && yarn migrate:latest && node server/src/index.js",
"start": "yarn build && yarn server",
"build": "yarn create-locales && node esbuild.config.mjs",
"server": "yarn create-area && yarn generate && yarn migrate:latest && node server/src/index.js",
"watch": "node esbuild.config.mjs --dev",
"dev": "nodemon server/src/index.js --watch server",
"build": "yarn create-locales && webpack --env prod",
"watch": "webpack --watch --env dev",
"generate": "node server/scripts/generateMasterfile.js",
"create-locales": "node server/scripts/createLocales.js",
"missing-locales": "node server/scripts/createLocales.js --missing",
"create-area": "node server/scripts/poracleToGeoJSON.js",
"config-migrate": "node server/scripts/configMigration.js",
"console": "node --experimental-repl-await ./server/scripts/console.js",
"migrate:make": "knex --knexfile server/knexfile.cjs migrate:make",
"migrate:latest": "knex --knexfile server/knexfile.cjs migrate:latest",
"migrate:rollback": "knex --knexfile server/knexfile.cjs migrate:rollback"
"migrate:rollback": "knex --knexfile server/knexfile.cjs migrate:rollback",
"release": "node server/scripts/newRelease.js"
},
"engines": {
"node": ">=14",
"node": ">=16",
"yarn": "1.22.x"
},
"devDependencies": {
"@babel/core": "^7.13.10",
"@babel/eslint-parser": "^7.13.10",
"@babel/plugin-transform-runtime": "^7.13.10",
"@babel/preset-env": "^7.13.12",
"@babel/preset-react": "^7.12.13",
"@sentry/webpack-plugin": "^1.18.3",
"autoprefixer": "^10.2.5",
"babel-loader": "^8.2.2",
"chalk": "^4.1.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^8.1.0",
"css-loader": "^5.1.4",
"css-minimizer-webpack-plugin": "^2.0.0",
"@craftamap/esbuild-plugin-html": "^0.3.1",
"@sentry/cli": "^1.73.0",
"dotenv": "^10.0.0",
"eslint": "^7.22.0",
"eslint-config-airbnb": "^18.2.1",
"esbuild": "^0.14.22",
"esbuild-plugin-eslinter": "^0.1.1",
"esbuild-plugin-mxn-copy": "^1.0.1",
"esbuild-plugin-path-alias": "^1.0.3",
"eslint": "^8.9.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.23.0",
"eslint-plugin-react-hooks": "^4",
"eslint-webpack-plugin": "^2.5.2",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.3.1",
"mini-css-extract-plugin": "^1.3.9",
"node-emoji": "^1.10.0",
"nodemon": "^2.0.7",
"postcss": "^8.3.5",
"postcss-loader": "^5.2.0",
"progress-bar-webpack-plugin": "^2.1.0",
"sass": "^1.35.2",
"sass-loader": "^11.0.1",
"webpack": "^5.27.2",
"webpack-cli": "^4.5.0"
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"nodemon": "^2.0.7"
},
"dependencies": {
"@apollo/client": "^3.3.11",
Expand Down Expand Up @@ -96,10 +79,10 @@
"morgan": "^1.10.0",
"mysql2": "^2.3.3",
"node-fetch": "2",
"node-geocoder": "^3.27.0",
"node-geocoder": "^4.0.0",
"nodes2ts": "^2.0.0",
"objection": "^3.0.0",
"ohbem": "^1.3.0",
"ohbem": "^1.4.0",
"passport": "^0.4.1",
"passport-discord": "https://github.com/tonestrike/passport-discord.git",
"passport-local": "^1.0.0",
Expand Down
Loading

0 comments on commit be8ae26

Please sign in to comment.