Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
63ad1a4
add custom user fields
TurtIeSocks Oct 7, 2022
8c7f875
Synced docker env vars with latest config
TurtIeSocks Oct 7, 2022
c36390f
Merge pull request #579 from WatWowMap/add-data-column
TurtIeSocks Oct 7, 2022
595fb36
house keeping
TurtIeSocks Oct 7, 2022
bcaaa2c
Fix logout issue
TurtIeSocks Oct 7, 2022
d11a767
scanNext fixes
TurtIeSocks Oct 8, 2022
aabcecb
dry up a lot of code
TurtIeSocks Oct 8, 2022
cdc783a
Consolidate ScanNext & ScanZone components
TurtIeSocks Oct 8, 2022
9f7e512
Fix Scan Zone Rendering
TurtIeSocks Oct 8, 2022
478db25
more linting cleanups
TurtIeSocks Oct 8, 2022
6838956
Merge pull request #581 from WatWowMap/house-keeping
TurtIeSocks Oct 8, 2022
6ab8afa
Merge branch 'develop' into scanNext-react-code-fixes
TurtIeSocks Oct 8, 2022
f6529ad
More Scan Zone Fixes
TurtIeSocks Oct 8, 2022
a09691d
Merge pull request #580 from WatWowMap/scanNext-react-code-fixes
TurtIeSocks Oct 8, 2022
dc47ac3
fix popup panning
TurtIeSocks Oct 9, 2022
e6979a4
Update config.js
TurtIeSocks Oct 12, 2022
2d6d6db
more checks
TurtIeSocks Oct 12, 2022
53f7cc2
Add a config api route
TurtIeSocks Oct 12, 2022
4d7f895
Synced docker env vars with latest config
TurtIeSocks Oct 12, 2022
ad836de
Merge pull request #583 from WatWowMap/config-api-route
TurtIeSocks Oct 12, 2022
f3dde87
Fix Holiday Animations
TurtIeSocks Oct 12, 2022
7d99142
Merge pull request #584 from WatWowMap/fix-holiday-animations
TurtIeSocks Oct 12, 2022
736e198
holiday effects v2
TurtIeSocks Oct 12, 2022
af57093
Synced docker env vars with latest config
TurtIeSocks Oct 12, 2022
57ab5b0
Merge pull request #585 from WatWowMap/holiday-effects-v2
TurtIeSocks Oct 12, 2022
133d19b
Config fixes
TurtIeSocks Oct 12, 2022
3df260b
Locales Catchup
TurtIeSocks Oct 13, 2022
faf1d10
Add missing `tr` to manual startup translations
TurtIeSocks Oct 13, 2022
8dd87eb
update de.json translation
ReuschelCGN Oct 13, 2022
f9e3256
Merge pull request #588 from ReuschelCGN/patch-1
TurtIeSocks Oct 13, 2022
dea6414
Update pl.json
TurtIeSocks Oct 13, 2022
af5e394
Merge branch 'locales-catchup' of https://github.com/WatWowMap/ReactM…
TurtIeSocks Oct 13, 2022
dd64ef9
adjust interaction ranges
TurtIeSocks Oct 13, 2022
569ad11
Merge pull request #589 from WatWowMap/adjust-interaction-ranges
TurtIeSocks Oct 13, 2022
35ee5d4
discord-logging
TurtIeSocks Oct 14, 2022
2f25413
Update Clients.js
TurtIeSocks Oct 14, 2022
93197d3
Separate Channels
TurtIeSocks Oct 14, 2022
86b74b7
Merge pull request #587 from WatWowMap/locales-catchup
TurtIeSocks Oct 14, 2022
4a4c672
Merge pull request #590 from WatWowMap/scan-next-discord-logging
TurtIeSocks Oct 14, 2022
9ddd342
Resolve #592
TurtIeSocks Oct 15, 2022
f4e34be
Update telegram.js
TurtIeSocks Oct 15, 2022
0ebb790
Update fr.json
TurtIeSocks Oct 15, 2022
c3840b8
update raid display text
TurtIeSocks Oct 15, 2022
deaf6e0
probably fix location for discord auth logging
TurtIeSocks Oct 15, 2022
08681dd
Area Fixes
TurtIeSocks Oct 16, 2022
a3b0718
fix parent selector
TurtIeSocks Oct 17, 2022
d6332b0
add area searching
TurtIeSocks Oct 17, 2022
6d96e85
Merge pull request #593 from WatWowMap/area-fixes
TurtIeSocks Oct 17, 2022
cb6d453
version bump
TurtIeSocks Oct 17, 2022
5c683d7
Update logUserAuth.js
TurtIeSocks Oct 17, 2022
1fc5e27
Check for default.json changes
TurtIeSocks Oct 18, 2022
e265c31
Merge pull request #595 from WatWowMap/default.json-warning
TurtIeSocks Oct 18, 2022
04b8c9a
add locale selector
TurtIeSocks Oct 21, 2022
44e5b61
Update config.yml
TurtIeSocks Oct 21, 2022
d21556a
Merge pull request #598 from WatWowMap/add-locale-selector
TurtIeSocks Oct 21, 2022
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
1 change: 1 addition & 0 deletions .configref
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18036
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ dist
node_modules
public/missing-locales
public/images/custom
public/images/uicons
public/images/uicons
server/src/configs/
6 changes: 2 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"inject": true
},
"rules": {
"global-require": 0,
"import/no-dynamic-require": 0,
"camelcase": 0,
"react/jsx-props-no-spreading": 0,
"linebreak-style": 0,
Expand Down Expand Up @@ -96,10 +98,6 @@
[
"@assets",
"./src/assets/"
],
[
"@classes",
"./src/classes/"
]
],
"extensions": [
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Config
on: [push]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
sync:
name: Check for config changes
runs-on: ubuntu-latest
steps:
- name: Checkout code
id: checkout-code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v19
with:
files: |
server/src/configs/default.json
- name: Run script
if: steps.changed-files.outputs.any_changed == 'true'
run: |
yarn config-check
- name: Commit and push changes
if: steps.changed-files.outputs.any_changed == 'true'
uses: devops-infra/action-commit-push@v0.9.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_message: Sync character count for config ref file
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ server/src/routes/api/v1/*
!server/src/routes/api/v1/users.js
!server/src/routes/api/v1/sessions.js
!server/src/routes/api/v1/available.js
!server/src/routes/api/v1/config.js

# custom model
server/src/models/Custom.js
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ dist
node_modules
public/missing-locales
public/images/custom
public/images/uicons
public/images/uicons
server/src/configs/
5 changes: 2 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"dbaeumer.vscode-eslint",
"lokalise.i18n-ally",
"esbenp.prettier-vscode",
"leizongmin.node-module-intellisense",
"eg2.vscode-npm-script",
"christian-kohler.npm-intellisense",
"graphql.vscode-graphql"
]
}
}
7 changes: 3 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"i18n-ally.localesPaths": [
"public/base-locales"
],
"i18n-ally.localesPaths": ["public/base-locales"],
"i18n-ally.keystyle": "flat",
"[javascript]": {
"editor.autoClosingBrackets": "always",
Expand All @@ -11,4 +9,5 @@
"editor.autoClosingBrackets": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
}
"editor.formatOnSave": true
}
12 changes: 12 additions & 0 deletions ReactMap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable import/extensions */
const { generate } = require('./server/scripts/generateMasterfile')
const { locales } = require('./server/scripts/createLocales')
const { connection } = require('./server/knexfile.cjs')

connection.migrate.latest().then(() =>
generate(true).then(() =>
locales()
.then(() => require('./esbuild.config.js'))
.then(() => require('./server/src/index')),
),
)
15 changes: 5 additions & 10 deletions ReactMap.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/* eslint-disable import/extensions */
import { generate } from './server/scripts/generateMasterfile.js'
import { locales } from './server/scripts/createLocales.js'
import { connection } from './server/knexfile.cjs'
/* eslint-disable no-console */
import './ReactMap.js'

connection.migrate.latest().then(() => (
generate(true)
.then(() => locales()
.then(() => import('./esbuild.config.mjs'))
.then(() => import('./server/src/index.js')))
))
console.warn(
'[WARN] ReactMap.mjs is being deprecated and support will be removed in version 1.8.0. Please change your PM2 script to use ReactMap.js instead.',
)
175 changes: 175 additions & 0 deletions esbuild.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
/* eslint-disable no-continue */
/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable no-console */
const { resolve, extname } = require('path')
const fs = require('fs')
const dotenv = require('dotenv')
const { build: compile } = require('esbuild')
const { createServer } = require('esbuild-server')
const { htmlPlugin } = require('@craftamap/esbuild-plugin-html')
const esbuildMxnCopy = require('esbuild-plugin-mxn-copy')
const aliasPlugin = require('esbuild-plugin-path-alias')
const { eslintPlugin } = require('esbuild-plugin-eslinter')

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

const hasCustom = (function checkFolders(folder, isCustom = false) {
const files = fs.readdirSync(folder)
for (let i = 0; i < files.length; i += 1) {
if (isCustom) return true
if (files[i].startsWith('.')) continue
if (!files[i].includes('.'))
isCustom = checkFolders(`${folder}/${files[i]}`, isCustom)
if (/\.custom.(jsx?|css)$/.test(files[i])) return true
}
return isCustom
})(resolve(__dirname, 'src'))

if (fs.existsSync(resolve(__dirname, 'dist'))) {
console.log('[BUILD] Cleaning up old build')
fs.rm(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(resolve(__dirname, 'public/index.html')),
scriptLoading: 'defer',
favicon: fs.existsSync(resolve(__dirname, 'public/favicon/favicon.ico'))
? resolve(__dirname, 'public/favicon/favicon.ico')
: resolve(__dirname, 'public/favicon/fallback.ico'),
extraScripts: isServing
? [{ src: '/esbuild-livereload.js', attrs: { async: true } }]
: undefined,
},
],
}),
esbuildMxnCopy({
copy: [
{ from: resolve(__dirname, './public/images'), to: 'dist/' },
{ from: resolve(__dirname, './public/locales'), to: 'dist/' },
],
}),
aliasPlugin({
'@components': resolve(__dirname, './src/components'),
'@assets': resolve(__dirname, './src/assets'),
'@hooks': resolve(__dirname, './src/hooks'),
'@services': resolve(__dirname, './src/services'),
}),
]

if (isDevelopment) {
plugins.push(eslintPlugin())
} else {
if (hasCustom) {
plugins.push({
name: 'Custom Loader',
setup(build) {
const customPaths = []
build.onLoad({ filter: /\.(jsx?|css)$/ }, async (args) => {
const isNodeModule = /node_modules/.test(args.path)
if (!isNodeModule) {
const ext = extname(args.path)
const newPath = args.path.replace(ext, `.custom${ext}`)
// console.log(ext, newPath)
if (fs.existsSync(newPath)) {
customPaths.push(newPath)
return {
contents: fs.readFileSync(newPath, 'utf8'),
loader: ext.replace('.', ''),
watchFiles: isDevelopment ? [newPath] : undefined,
}
}
}
})
build.onEnd(() => {
if (customPaths.length && !isDevelopment) {
console.log(`
======================================================
WARNING:
Custom files aren't officially supported
Be sure to watch for breaking changes!

${customPaths.map((x, i) => ` ${i + 1}. src/${x.split('src/')[1]}`).join('\n')}

======================================================
`)
}
})
},
})
}
console.log(`[BUILD] Building production version: ${version}`)
}

const esbuild = {
entryPoints: ['src/index.jsx'],
legalComments: 'none',
bundle: true,
outdir: 'dist/',
publicPath: '/',
entryNames: isDevelopment ? undefined : `[name]-${version}-[hash]`,
metafile: true,
minify: env.parsed.NO_MINIFIED ? false : isRelease || !isDevelopment,
logLevel: isDevelopment ? 'info' : 'error',
target: ['safari11.1', 'chrome64', 'firefox66', 'edge88'],
watch: isDevelopment
? {
onRebuild(error) {
if (error) console.error('Recompiling failed:', error)
else console.log('Recompiled successfully')
},
}
: false,
sourcemap: isRelease || isDevelopment,
define: {
inject: JSON.stringify({
GOOGLE_ANALYTICS_ID: env.parsed.GOOGLE_ANALYTICS_ID || '',
ANALYTICS_DEBUG_MODE: env.parsed.ANALYTICS_DEBUG_MODE || false,
TITLE: env.parsed.TITLE || env.parsed.MAP_GENERAL_TITLE || '',
SENTRY_DSN: env.parsed.SENTRY_DSN || '',
SENTRY_TRACES_SAMPLE_RATE: env.parsed.SENTRY_TRACES_SAMPLE_RATE || 0.1,
SENTRY_DEBUG: env.parsed.SENTRY_DEBUG || false,
VERSION: version,
DEVELOPMENT: isDevelopment,
CUSTOM: hasCustom,
LOCALES: fs.readdirSync(resolve(__dirname, 'public/locales')),
}),
},
plugins,
}

try {
if (isServing) {
if (!env.parsed.DEV_PORT)
throw new Error(
'DEV_PORT is not set, in .env file, it should match the port you set in your config',
)
createServer(esbuild, {
port: +env.parsed.DEV_PORT + 1,
static: 'public',
open: true,
proxy: {
'/': `http://localhost:${env.parsed.DEV_PORT}`,
},
}).start()
} else {
compile(esbuild).then(() => console.log('[BUILD] React Map Compiled'))
}
} catch (e) {
console.error(e)
process.exit(1)
}
Loading