Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserved for 2.0 #1000

Draft
wants to merge 16 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
149 changes: 72 additions & 77 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,92 +1,87 @@
{
"extends": ["airbnb", "airbnb/rules/react", "eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": "latest"
},
"$schema": "https://json.schemastore.org/eslintrc.json",
"root": true,
"env": {
"browser": true,
"jest": true,
"browser": false,
"es2023": true,
"node": true
},
"globals": {
"document": true,
"window": true,
"CONFIG": true
},
"extends": [
"plugin:prettier/recommended"
],
"plugins": [
"unused-imports",
"@typescript-eslint",
"import",
"prettier"
],
"parser": "@typescript-eslint/parser",
"rules": {
"global-require": 0,
"lines-between-class-members": 0,
"no-continue": 0,
"no-plusplus": 0,
"import/no-dynamic-require": 0,
"camelcase": 0,
"react/jsx-props-no-spreading": 0,
"linebreak-style": 0,
"react/prop-types": 0,
"no-confusing-arrow": 0,
"no-restricting-syntax": 0,
"semi": 0,
"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,
"no-nested-ternary": "off",
"import/prefer-default-export": 0,
"max-len": [
"error",
120,
2,
"no-console": "warn",
"prettier/prettier": "warn",
"no-unused-vars": "off",
"unused-imports/no-unused-vars": "off",
"unused-imports/no-unused-imports": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"ignoreUrls": true,
"ignoreComments": true,
"ignoreRegExpLiterals": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignorePattern": "^(.*)@typedef(.*)"
"args": "after-used",
"ignoreRestSiblings": false,
"argsIgnorePattern": "^_.*?$"
}
],
"no-unused-vars": [
"error",
"import/order": [
"warn",
{
"varsIgnorePattern": "^TypesDefs(.*)"
"groups": [
"type",
"builtin",
"object",
"external",
"internal",
"parent",
"sibling",
"index"
],
"pathGroups": [
{
"pattern": "~/**",
"group": "external",
"position": "after"
}
],
"newlines-between": "always"
}
],
"object-curly-newline": [
"error",
"padding-line-between-statements": [
"warn",
{
"ExportDeclaration": {
"minProperties": 4
}
}
]
},
"settings": {
"node": {
"extensions": [".mjs", ".js", ".jsx", ".ts", ".tsx"]
},
"import/resolver": {
"alias": {
"map": [
["@components", "./src/components/"],
["@features", "./src/features/"],
["@services", "./src/services/"],
["@hooks", "./src/hooks/"],
["@assets", "./src/assets/"],
["@utils", "./src/utils/"],
["@store", "./src/store/"]
"blankLine": "always",
"prev": "*",
"next": "return"
},
{
"blankLine": "always",
"prev": [
"const",
"let",
"var"
],
"extensions": [".mjs", ".js", ".jsx", ".ts", ".tsx"]
"next": "*"
},
{
"blankLine": "any",
"prev": [
"const",
"let",
"var"
],
"next": [
"const",
"let",
"var"
]
}
}
]
}
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ server/src/configs/**/*
config/local.json
config/areas.json
!server/src/configs/.gitkeep
config/user/**/*
.env

# Masterfile
Expand Down
4 changes: 2 additions & 2 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# . "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit "${1}"
# npx --no -- commitlint --edit "${1}"
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# . "$(dirname "$0")/_/husky.sh"

npx lint-staged --verbose
# npx lint-staged --verbose
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
},
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib"
}
}
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ ENV PATH=$PATH:/home/node/.npm-global/bin
WORKDIR /home/node
COPY package.json .
COPY yarn.lock .
RUN apk add git
RUN npm install -g yarn
COPY . .
RUN yarn install
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img width="390" alt="ReactMap_Logo" src="https://user-images.githubusercontent.com/58572875/167069223-745a139d-f485-45e3-a25c-93ec4d09779c.png">
</p>

# ReactMap
# ReactMap 2.0

[![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/)
Expand Down
7 changes: 2 additions & 5 deletions ReactMap.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// @ts-check
/* eslint-disable import/no-extraneous-dependencies */
const { build } = require('vite')

const { log, TAGS } = require('@rm/logger')
const { generate } = require('@rm/masterfile')

generate(true).then(() =>
build()
require('@rm/client')
.then(() => log.info(TAGS.build, 'React Map Compiled'))
.then(() => require('./server/src/index')),
.then(() => require('@rm/server')),
)
51 changes: 51 additions & 0 deletions client/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"env": {
"browser": true,
"es2023": true,
"node": false
},
"globals": {
"CONFIG": true
},
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
"../.eslintrc"
],
"plugins": [
"react",
"jsx-a11y"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 15
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"react/prop-types": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react-hooks/exhaustive-deps": "off",
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/interactive-supports-focus": "warn",
"react/self-closing-comp": "warn",
"react/jsx-sort-props": [
"warn",
{
"callbacksLast": true,
"shorthandFirst": true,
"noSortAlphabetically": false,
"reservedFirst": true
}
]
}
}
14 changes: 14 additions & 0 deletions client/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @ts-check

const { build } = require('vite')

const viteConfig = require('./vite.config')

process.env.SKIP_CONFIG = 'true'

module.exports = build(
viteConfig({
mode: process.env.NODE_ENV || 'production',
command: 'build',
}),
)
2 changes: 1 addition & 1 deletion index.html → client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ <h4 class="loading-text">This app requires JavaScript</h4>
rel="stylesheet"
href="https://use.fontawesome.com/releases/v6.4.0/css/all.css"
/>
<script type="module" src="/src/index.jsx"></script>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
64 changes: 64 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "@rm/client",
"version": "1.0.0",
"private": true,
"main": "./build.js",
"scripts": {
"build": "vite build",
"release": "vite build -- -r",
"watch": "vite"
},
"dependencies": {
"@apollo/client": "3.11.4",
"@emotion/react": "11.13.0",
"@emotion/styled": "11.13.0",
"@monaco-editor/react": "4.6.0",
"@mui/icons-material": "5.16.7",
"@mui/lab": "5.0.0-alpha.173",
"@mui/material": "5.16.7",
"@rm/config": "*",
"@rm/locales": "*",
"@rm/logger": "*",
"@sentry/react": "^7.65.0",
"@turf/boolean-point-in-polygon": "7.1.0",
"@turf/destination": "7.1.0",
"@turf/helpers": "7.1.0",
"@turtlesocks/react-leaflet.locatecontrol": "^0.1.1",
"dlv": "^1.1.3",
"graphql": "16.9.0",
"i18next": "23.12.3",
"i18next-browser-languagedetector": "8.0.0",
"i18next-fs-backend": "2.3.2",
"i18next-http-backend": "2.5.2",
"leaflet": "1.9.4",
"leaflet.locatecontrol": "0.81.0",
"lodash": "^4.17.21",
"nodes2ts": "3.0.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-ga4": "^1.4.1",
"react-i18next": "15.0.1",
"react-leaflet": "4.2.1",
"react-router-dom": "^6.15.0",
"react-virtuoso": "4.10.1",
"suncalc": "^1.9.0",
"supercluster": "^8.0.1",
"uicons.js": "2.0.2",
"zustand": "4.4.6"
},
"devDependencies": {
"@rm/types": "*",
"@sentry/vite-plugin": "2.10.3",
"@types/leaflet": "1.9.12",
"@types/leaflet.locatecontrol": "0.74.5",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/suncalc": "1.9.2",
"@types/supercluster": "7.1.3",
"@vitejs/plugin-react-swc": "3.7.0",
"monaco-editor": "^0.41.0",
"rollup-plugin-delete": "^2.0.0",
"vite": "5.4.6",
"vite-plugin-checker": "0.7.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ const fs = require('fs')
const customFilePlugin = (isDevelopment) => {
const fileRegex = /\.(jsx?|css)$/
const customPaths = []

return {
name: 'vite-plugin-custom-file-checker',
load(id) {
if (fileRegex.test(id) && !/node_modules/.test(id)) {
const ext = extname(id)
const newPath = id.replace(ext, `.custom${ext}`)

if (fs.existsSync(newPath)) {
customPaths.push(newPath)

return {
code: fs.readFileSync(newPath, 'utf8'),
map: null,
Expand Down
Loading
Loading