diff --git a/.eslintignore b/.eslintignore index 8baa9f15c..e15880cb6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,4 +2,5 @@ dist node_modules public/missing-locales public/images/custom -public/images/uicons \ No newline at end of file +public/images/uicons +server/src/configs/ diff --git a/.eslintrc b/.eslintrc index 63aa8e312..d30ae0e9e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -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, @@ -96,10 +98,6 @@ [ "@assets", "./src/assets/" - ], - [ - "@classes", - "./src/classes/" ] ], "extensions": [ diff --git a/.prettierignore b/.prettierignore index 8baa9f15c..e15880cb6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,4 +2,5 @@ dist node_modules public/missing-locales public/images/custom -public/images/uicons \ No newline at end of file +public/images/uicons +server/src/configs/ diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 89f244ad1..69466d568 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -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" ] -} \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 4bb8cedef..e71a380c8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,5 @@ { - "i18n-ally.localesPaths": [ - "public/base-locales" - ], + "i18n-ally.localesPaths": ["public/base-locales"], "i18n-ally.keystyle": "flat", "[javascript]": { "editor.autoClosingBrackets": "always", @@ -11,4 +9,5 @@ "editor.autoClosingBrackets": "always", "editor.defaultFormatter": "esbenp.prettier-vscode" }, -} \ No newline at end of file + "editor.formatOnSave": true +} diff --git a/ReactMap.js b/ReactMap.js new file mode 100644 index 000000000..fde2baa28 --- /dev/null +++ b/ReactMap.js @@ -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')), + ), +) diff --git a/ReactMap.mjs b/ReactMap.mjs index be829f56f..e096b4004 100644 --- a/ReactMap.mjs +++ b/ReactMap.mjs @@ -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.', +) diff --git a/esbuild.config.js b/esbuild.config.js new file mode 100644 index 000000000..b19a4bde2 --- /dev/null +++ b/esbuild.config.js @@ -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) +} diff --git a/esbuild.config.mjs b/esbuild.config.mjs deleted file mode 100644 index 257a8cda4..000000000 --- a/esbuild.config.mjs +++ /dev/null @@ -1,180 +0,0 @@ -/* eslint-disable no-await-in-loop */ -/* eslint-disable no-continue */ -/* eslint-disable no-restricted-syntax */ -/* 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 as compile } from 'esbuild' -import { createServer } from 'esbuild-server' -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 __dirname = path.dirname(fileURLToPath(import.meta.url)) -const env = fs.existsSync(`${__dirname}/.env`) ? dotenv.config() : { parsed: process.env } -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')) -const isServing = Boolean(process.argv.includes('--serve')) - -const hasCustom = await (async function checkFolders(folder, isCustom = false) { - for (const file of await fs.promises.readdir(folder)) { - if (isCustom) return true - if (file.startsWith('.')) continue - if (!file.includes('.')) isCustom = await checkFolders(`${folder}/${file}`, isCustom) - if (/\.custom.(jsx?|css)$/.test(file)) return true - } - return isCustom -}(path.resolve(__dirname, 'src'))) - -if (fs.existsSync(path.resolve(__dirname, 'dist'))) { - console.log('[BUILD] 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(path.resolve(__dirname, './public/index.html')), - scriptLoading: 'defer', - favicon: fs.existsSync(path.resolve(__dirname, './public/favicon/favicon.ico')) - ? path.resolve(__dirname, './public/favicon/favicon.ico') - : path.resolve(__dirname, './public/favicon/fallback.ico'), - extraScripts: isServing ? [ - { src: '/esbuild-livereload.js', attrs: { async: true } }, - ] : undefined, - }, - ], - }), - esbuildMxnCopy({ - copy: [ - { from: path.resolve(__dirname, './public/images'), to: 'dist/' }, - { from: path.resolve(__dirname, './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 { - 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 [base, suffix] = args.path.split('.') - const newPath = `${base}.custom.${suffix}` - if (fs.existsSync(newPath)) { - customPaths.push(newPath) - return { - contents: fs.readFileSync(newPath, 'utf8'), - loader: suffix, - 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: await fs.promises.readdir(`${__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') - await createServer( - esbuild, - { - port: +env.parsed.DEV_PORT + 1, - static: 'public', - open: true, - proxy: { - '/': `http://localhost:${env.parsed.DEV_PORT}`, - }, - }, - ).start() - } else { - await compile(esbuild) - } -} catch (e) { - console.error(e) - process.exit(1) -} finally { - console.log('[BUILD] React Map Compiled') -} diff --git a/jsconfig.json b/jsconfig.json index ba0810aba..c608dbdd8 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,15 +1,15 @@ { "compilerOptions": { "target": "es2017", + "module": "commonjs", "allowSyntheticDefaultImports": false, "baseUrl": "./src", "paths": { "@assets/*": ["./assets/*"], "@components/*": ["./components/*"], "@services/*": ["./services/*"], - "@hooks/*": ["./hooks/*"], - "@classes/*": ["./classes/*"], + "@hooks/*": ["./hooks/*"] } }, - "exclude": ["node_modules", "dist"], -} \ No newline at end of file + "exclude": ["node_modules", "**/node_modules/*", "dist"] +} diff --git a/package.json b/package.json index 9fd85002f..cce78bfff 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,17 @@ { "name": "reactmap", - "version": "1.5.0", + "version": "1.5.1", "description": "React based frontend map.", - "main": "ReactMap.mjs", + "main": "ReactMap.js", "author": "TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com>", "license": "MIT", "private": true, "scripts": { "start": "node .", - "build": "yarn create-locales && node esbuild.config.mjs", + "build": "yarn create-locales && node esbuild.config.js", "server": "yarn create-area && yarn generate && yarn migrate:latest && node server/src/index.js", - "watch": "node esbuild.config.mjs --dev", - "serve": "node esbuild.config.mjs --dev --serve", + "watch": "node esbuild.config.js --dev", + "serve": "node esbuild.config.js --dev --serve", "dev": "nodemon server/src/index.js --watch server", "generate": "node server/scripts/generateMasterfile.js", "gen-env-config": "node server/scripts/genEnvConfig.js", @@ -115,4 +115,4 @@ "suncalc": "^1.8.0", "zustand": "^4.0.0-rc.1" } -} +} \ No newline at end of file diff --git a/server/src/data/defaultRarity.json b/server/src/data/defaultRarity.json index 9fa61caf1..d6b018502 100644 --- a/server/src/data/defaultRarity.json +++ b/server/src/data/defaultRarity.json @@ -1,21 +1,58 @@ { "common": [ - 1,4,7,10,13,16,19,21,23,25,27,29,32,35,37,39,41,43,46,48,50,52,54,56,58,60,63,66,69,72,74,77,79,81,84,86,88,90,92,95,96,98,100,102,104,109,111,116,118,120,123,129,133,138,140,152,155,158,161,163,165,167,170,177,179,183,187,190,191,193,194,198,200,204,207,209,215,216,218,220,223,228,231,252,255,258,261,263,265,270,273,276,278,280,283,285,287,293,296,299,300,304,307,309,311,312,315,316,318,320,322,325,328,331,333,339,341,343,345,347,349,351,353,355,361,363,366,370,387,390,393,396,399,401,412,415,418,420,421,425,427,431,434,436,449,451,453,456,459,495,498,501,504,506,509,517,519,527,529,535,540,543,546,548,551,557,562,568,570,572,577,580,582,585,588,590,592,602,605,613,616,619,624,629,650,653,656,659,661,667 + 1, 4, 7, 10, 13, 16, 19, 21, 23, 25, 27, 29, 32, 35, 37, 39, 41, 43, 46, 48, + 50, 52, 54, 56, 58, 60, 63, 66, 69, 72, 74, 77, 79, 81, 84, 86, 88, 90, 92, + 95, 96, 98, 100, 102, 104, 109, 111, 116, 118, 120, 123, 129, 133, 138, 140, + 152, 155, 158, 161, 163, 165, 167, 170, 177, 179, 183, 187, 190, 191, 193, + 194, 198, 200, 204, 207, 209, 215, 216, 218, 220, 223, 228, 231, 252, 255, + 258, 261, 263, 265, 270, 273, 276, 278, 280, 283, 285, 287, 293, 296, 299, + 300, 304, 307, 309, 311, 312, 315, 316, 318, 320, 322, 325, 328, 331, 333, + 339, 341, 343, 345, 347, 349, 351, 353, 355, 361, 363, 366, 370, 387, 390, + 393, 396, 399, 401, 412, 415, 418, 420, 421, 425, 427, 431, 434, 436, 449, + 451, 453, 456, 459, 495, 498, 501, 504, 506, 509, 517, 519, 527, 529, 535, + 540, 543, 546, 548, 551, 557, 562, 568, 570, 572, 577, 580, 582, 585, 588, + 590, 592, 602, 605, 613, 616, 619, 624, 629, 650, 653, 656, 659, 661, 667 ], "uncommon": [ - 2,5,8,11,14,17,20,22,24,26,30,33,36,38,40,42,44,47,49,51,53,55,57,59,61,64,67,70,73,75,78,80,82,85,87,89,91,93,97,99,101,103,105,110,112,117,119,121,124,125,126,127,139,141,153,156,159,162,164,166,168,171,178,180,184,185,188,195,202,203,205,206,210,211,213,217,219,221,224,226,227,229,234,253,256,259,262,264,266,268,271,274,277,279,281,284,286,288,294,297,301,302,305,308,310,317,319,323,326,329,332,340,342,344,346,348,354,356,362,364,388,391,394,397,400,402,419,426,428,432,435,437,450,452,454,457,460,496,499,502,505,507,510,520,522,524,528,536,541,544,547,549,552,558,563,569,573,578,581,583,586,587,591,595,603,606,614,615,620,651,654,657,660,662,668 + 2, 5, 8, 11, 14, 17, 20, 22, 24, 26, 30, 33, 36, 38, 40, 42, 44, 47, 49, 51, + 53, 55, 57, 59, 61, 64, 67, 70, 73, 75, 78, 80, 82, 85, 87, 89, 91, 93, 97, + 99, 101, 103, 105, 110, 112, 117, 119, 121, 124, 125, 126, 127, 139, 141, + 153, 156, 159, 162, 164, 166, 168, 171, 178, 180, 184, 185, 188, 195, 202, + 203, 205, 206, 210, 211, 213, 217, 219, 221, 224, 226, 227, 229, 234, 253, + 256, 259, 262, 264, 266, 268, 271, 274, 277, 279, 281, 284, 286, 288, 294, + 297, 301, 302, 305, 308, 310, 317, 319, 323, 326, 329, 332, 340, 342, 344, + 346, 348, 354, 356, 362, 364, 388, 391, 394, 397, 400, 402, 419, 426, 428, + 432, 435, 437, 450, 452, 454, 457, 460, 496, 499, 502, 505, 507, 510, 520, + 522, 524, 528, 536, 541, 544, 547, 549, 552, 558, 563, 569, 573, 578, 581, + 583, 586, 587, 591, 595, 603, 606, 614, 615, 620, 651, 654, 657, 660, 662, + 668 ], "rare": [ - 3,6,9,12,15,18,28,31,34,45,62,65,68,71,76,94,106,107,108,113,114,130,131,132,134,135,136,137,142,143,144,154,157,160,169,176,181,189,232,235,237,241,242,254,257,260,267,269,272,275,282,289,295,306,330,358,365,389,392,395,398,408,409,410,411,413,414,497,500,503,508,518,521,523,525,526,530,531,537,542,545,553,554,555,564,565,566,567,571,574,575,576,579,584,589,593,594,596,597,598,604,617,618,621,622,623,625,630,636,637,652,655,658 + 3, 6, 9, 12, 15, 18, 28, 31, 34, 45, 62, 65, 68, 71, 76, 94, 106, 107, 108, + 113, 114, 130, 131, 132, 134, 135, 136, 137, 142, 143, 144, 154, 157, 160, + 169, 176, 181, 189, 232, 235, 237, 241, 242, 254, 257, 260, 267, 269, 272, + 275, 282, 289, 295, 306, 330, 358, 365, 389, 392, 395, 398, 408, 409, 410, + 411, 413, 414, 497, 500, 503, 508, 518, 521, 523, 525, 526, 530, 531, 537, + 542, 545, 553, 554, 555, 564, 565, 566, 567, 571, 574, 575, 576, 579, 584, + 589, 593, 594, 596, 597, 598, 604, 617, 618, 621, 622, 623, 625, 630, 636, + 637, 652, 655, 658 ], "ultraRare": [ - 147,148,149,201,246,247,248,371,372,373,374,375,376,443,444,445,607,608,609,610,611,612,633,634,635,714,715 + 147, 148, 149, 201, 246, 247, 248, 371, 372, 373, 374, 375, 376, 443, 444, + 445, 607, 608, 609, 610, 611, 612, 633, 634, 635, 714, 715 ], "regional": [ - 83,115,122,128,214,222,313,314,324,335,336,337,338,357,369,417,422,423,439,441,455,480,481,482,511,512,513,514,515,516,538,539,550,556,561,626,631,632,707 + 83, 115, 122, 128, 214, 222, 313, 314, 324, 335, 336, 337, 338, 357, 369, + 417, 422, 423, 439, 441, 455, 480, 481, 482, 511, 512, 513, 514, 515, 516, + 538, 539, 550, 556, 561, 626, 631, 632, 707 ], "never": [ - 172,173,174,175,182,186,192,196,197,199,208,212,225,230,233,236,238,239,240,290,291,292,298,303,321,327,334,350,352,359,360,367,368,403,404,405,406,407,416,424,429,430,433,438,439,440,442,446,447,448,458,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,532,533,534,559,560,599,600,601,627,628,677,678 + 172, 173, 174, 175, 182, 186, 192, 196, 197, 199, 208, 212, 225, 230, 233, + 236, 238, 239, 240, 290, 291, 292, 298, 303, 321, 327, 334, 350, 352, 359, + 360, 367, 368, 403, 404, 405, 406, 407, 416, 424, 429, 430, 433, 438, 439, + 440, 442, 446, 447, 448, 458, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 532, 533, 534, 559, 560, + 599, 600, 601, 627, 628, 677, 678 ], "event": [] } diff --git a/server/src/index.js b/server/src/index.js index 6bdab66d9..0c75f1716 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -1,6 +1,4 @@ /* eslint-disable no-console */ -/* eslint-disable import/no-dynamic-require */ -/* eslint-disable global-require */ process.title = 'ReactMap' const path = require('path') diff --git a/server/src/routes/api/apiIndex.js b/server/src/routes/api/apiIndex.js index d5a2e8108..e498e8941 100644 --- a/server/src/routes/api/apiIndex.js +++ b/server/src/routes/api/apiIndex.js @@ -1,6 +1,4 @@ /* eslint-disable no-console */ -/* eslint-disable import/no-dynamic-require */ -/* eslint-disable global-require */ const router = require('express').Router() const fs = require('fs') diff --git a/server/src/routes/authRouter.js b/server/src/routes/authRouter.js index f9f78a474..714b1d64e 100644 --- a/server/src/routes/authRouter.js +++ b/server/src/routes/authRouter.js @@ -1,5 +1,3 @@ -/* eslint-disable global-require */ -/* eslint-disable import/no-dynamic-require */ /* eslint-disable no-console */ const router = require('express').Router() const passport = require('passport') diff --git a/server/src/services/DiscordClient.js b/server/src/services/DiscordClient.js index 94822e012..d14364d5b 100644 --- a/server/src/services/DiscordClient.js +++ b/server/src/services/DiscordClient.js @@ -2,8 +2,6 @@ /* eslint-disable class-methods-use-this */ /* eslint-disable no-await-in-loop */ /* eslint-disable no-restricted-syntax */ -/* eslint-disable global-require */ -/* eslint-disable import/no-dynamic-require */ /* global BigInt */ const fs = require('fs') const { diff --git a/server/src/services/config.js b/server/src/services/config.js index df563eecc..a080e6178 100644 --- a/server/src/services/config.js +++ b/server/src/services/config.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-dynamic-require */ -/* eslint-disable global-require */ /* eslint-disable no-console */ process.env.NODE_CONFIG_DIR = `${__dirname}/../configs` diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 46d9ad7a1..281782510 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -83,7 +83,7 @@ export default function Map({ const [lc] = useState( L.control.locate({ position: 'bottomright', - icon: 'fas fa-location-arrow', + icon: 'fas fa-crosshairs', keepCurrentZoomLevel: true, setView: 'untilPan', }), diff --git a/src/components/layout/dialogs/tutorial/data.json b/src/components/layout/dialogs/tutorial/data.json index 32130fb1a..02fc2eef6 100644 --- a/src/components/layout/dialogs/tutorial/data.json +++ b/src/components/layout/dialogs/tutorial/data.json @@ -93,121 +93,46 @@ "xlKarp": true, "xsRat": true, "ivOr": { - "great": [ - 1, - 100 - ], - "ultra": [ - 1, - 100 - ], - "iv": [ - 0, - 100 - ], - "level": [ - 1, - 35 - ] + "great": [1, 100], + "ultra": [1, 100], + "iv": [0, 100], + "level": [1, 35] }, "standard": { "enabled": false, "size": "md", - "iv": [ - 0, - 100 - ], - "atk_iv": [ - 0, - 15 - ], - "def_iv": [ - 0, - 15 - ], - "sta_iv": [ - 0, - 15 - ], - "level": [ - 1, - 35 - ], - "great": [ - 1, - 100 - ], - "ultra": [ - 1, - 100 - ] + "iv": [0, 100], + "atk_iv": [0, 15], + "def_iv": [0, 15], + "sta_iv": [0, 15], + "level": [1, 35], + "great": [1, 100], + "ultra": [1, 100] }, "filter": { "1-163": { "enabled": false, "size": "md", "adv": "", - "iv": [ - 0, - 100 - ], - "atk_iv": [ - 0, - 15 - ], - "def_iv": [ - 0, - 15 - ], - "sta_iv": [ - 0, - 15 - ], - "level": [ - 1, - 35 - ], - "great": [ - 1, - 100 - ], - "ultra": [ - 1, - 100 - ] + "iv": [0, 100], + "atk_iv": [0, 15], + "def_iv": [0, 15], + "sta_iv": [0, 15], + "level": [1, 35], + "great": [1, 100], + "ultra": [1, 100] }, "1-897": { "enabled": false, "size": "md", "adv": "", - "iv": [ - 0, - 100 - ], - "atk_iv": [ - 0, - 15 - ], - "def_iv": [ - 0, - 15 - ], - "sta_iv": [ - 0, - 15 - ], - "level": [ - 1, - 35 - ], - "great": [ - 1, - 100 - ], - "ultra": [ - 1, - 100 - ] + "iv": [0, 100], + "atk_iv": [0, 15], + "def_iv": [0, 15], + "sta_iv": [0, 15], + "level": [1, 35], + "great": [1, 100], + "ultra": [1, 100] } } }, @@ -347,4 +272,4 @@ } ] } -} \ No newline at end of file +} diff --git a/src/components/layout/dialogs/webhooks/Location.jsx b/src/components/layout/dialogs/webhooks/Location.jsx index 2a2960d40..639a679e9 100644 --- a/src/components/layout/dialogs/webhooks/Location.jsx +++ b/src/components/layout/dialogs/webhooks/Location.jsx @@ -7,7 +7,7 @@ import { CircularProgress, } from '@material-ui/core' import { Autocomplete } from '@material-ui/lab' -import { LocationOn } from '@material-ui/icons' +import { LocationOn, MyLocation } from '@material-ui/icons' import { useLazyQuery } from '@apollo/client' import { useMapEvents } from 'react-leaflet' @@ -93,7 +93,7 @@ const Location = ({ variant="contained" color="secondary" onClick={() => lc._onClick()} - startIcon={} + startIcon={} > {t('my_location')} diff --git a/src/services/queries/user.js b/src/services/queries/user.js index c31cd43c7..89a40e255 100644 --- a/src/services/queries/user.js +++ b/src/services/queries/user.js @@ -28,4 +28,4 @@ export const setExtraFields = gql` mutation SetExtraFields($key: String, $value: String) { setExtraFields(key: $key, value: $value) } -` \ No newline at end of file +`