Skip to content

Commit b15cde6

Browse files
committed
Merge branch 'upstream'
# Conflicts: # README.md # package.json # pnpm-lock.yaml # src/components/ActivityList/index.tsx # src/components/Header/index.tsx # src/components/Layout/index.tsx # src/components/RunMap/index.tsx # src/components/RunTable/index.tsx # src/components/YearStat/index.tsx # src/hooks/useActivities.ts # src/pages/index.tsx # src/utils/utils.ts
2 parents 32abe07 + d2346f4 commit b15cde6

38 files changed

Lines changed: 2982 additions & 3531 deletions

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
src/static/activities.json
2-
pnpm-lock.yaml
2+
src/static/world.zh.json
3+
pnpm-lock.yaml

assets/index.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
export const yearStats = import.meta.glob('./year_*.svg', { import: 'ReactComponent' })
2-
export const yearSummaryStats = import.meta.glob('./year_summary_*.svg', { import: 'ReactComponent' })
3-
export const githubYearStats = import.meta.glob('./github_*.svg', { import: 'ReactComponent' })
4-
export const totalStat = import.meta.glob(['./github.svg', './grid.svg', './mol.svg'], { import: 'ReactComponent' })
1+
export const yearStats = import.meta.glob('./year_*.svg', {
2+
import: 'ReactComponent',
3+
});
4+
export const yearSummaryStats = import.meta.glob('./year_summary_*.svg', {
5+
import: 'ReactComponent',
6+
});
7+
export const githubYearStats = import.meta.glob('./github_*.svg', {
8+
import: 'ReactComponent',
9+
});
10+
export const totalStat = import.meta.glob(
11+
['./github.svg', './grid.svg', './mol*.svg'],
12+
{
13+
import: 'ReactComponent',
14+
}
15+
);
Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,46 @@
1-
const tsParser = require('@typescript-eslint/parser');
2-
const tsPlugin = require('@typescript-eslint/eslint-plugin');
3-
const globals = require('globals');
4-
const react = require('eslint-plugin-react');
5-
const prettier = require('eslint-plugin-prettier');
6-
const js = require('@eslint/js');
1+
import eslintReact from '@eslint-react/eslint-plugin';
2+
import js from '@eslint/js';
3+
import tsParser from '@typescript-eslint/parser';
4+
import tsPlugin from '@typescript-eslint/eslint-plugin';
5+
import globals from 'globals';
6+
import reactHooks from 'eslint-plugin-react-hooks';
77

8-
module.exports = [
8+
const reactRecommended = eslintReact.configs['recommended-typescript'];
9+
const reactRulesAsWarnings = Object.fromEntries(
10+
Object.entries(reactRecommended.rules).map(([rule, config]) => {
11+
if (Array.isArray(config)) {
12+
return [rule, ['warn', ...config.slice(1)]];
13+
}
14+
return [rule, 'warn'];
15+
})
16+
);
17+
18+
export default [
19+
{
20+
ignores: [
21+
'**/node_modules/',
22+
'**/dist/',
23+
'**/pyproject.toml',
24+
'**/LICENSE',
25+
'**/*lock.*',
26+
'**/*.html',
27+
'**/*.md',
28+
'**/*.css',
29+
'**/*.svg',
30+
'**/*.png',
31+
'**/*.jpg',
32+
'**/*.ico',
33+
'**/*.lock',
34+
'**/*.min.js',
35+
],
36+
},
937
js.configs.recommended,
1038
{
1139
files: ['**/*.{js,jsx,ts,tsx}'],
1240
languageOptions: {
1341
parser: tsParser,
1442
globals: {
1543
...globals.browser,
16-
NodeJS: true,
1744
},
1845
ecmaVersion: 'latest',
1946
sourceType: 'module',
@@ -24,23 +51,16 @@ module.exports = [
2451
},
2552
},
2653
plugins: {
54+
...reactRecommended.plugins,
55+
...reactHooks.configs.flat.recommended.plugins,
2756
'@typescript-eslint': tsPlugin,
28-
react,
29-
prettier,
30-
},
31-
settings: {
32-
react: {
33-
version: 'detect',
34-
},
3557
},
58+
settings: reactRecommended.settings,
3659
rules: {
37-
// React recommended rules
38-
...react.configs.recommended.rules,
39-
...react.configs['jsx-runtime'].rules,
40-
41-
// Custom rules
42-
'prettier/prettier': 'off',
43-
'react/prop-types': 'off',
60+
...reactRulesAsWarnings,
61+
...reactHooks.configs.flat.recommended.rules,
62+
'react-hooks/set-state-in-effect': 'warn',
63+
'react-hooks/static-components': 'warn',
4464
'no-unused-vars': 'off',
4565
'@typescript-eslint/no-unused-vars': [
4666
'warn',
@@ -54,22 +74,4 @@ module.exports = [
5474
],
5575
},
5676
},
57-
{
58-
ignores: [
59-
'**/node_modules/',
60-
'**/dist/',
61-
'**/pyproject.toml',
62-
'**/LICENSE',
63-
'**/*lock.*',
64-
'**/*.html',
65-
'**/*.md',
66-
'**/*.css',
67-
'**/*.svg',
68-
'**/*.png',
69-
'**/*.jpg',
70-
'**/*.ico',
71-
'**/*.lock',
72-
'**/*.min.js',
73-
],
74-
},
7577
];

package.json

Lines changed: 33 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,24 @@
66
"packageManager": "[email protected]+sha256.8f5264ad1d100da11a6add6bb8a94c6f1e913f9e9261b2a551fabefad2ec0fec",
77
"dependencies": {
88
"@mapbox/mapbox-gl-language": "^1.0.1",
9-
"@mapbox/polyline": "^1.2.0",
9+
"@mapbox/polyline": "^1.2.1",
1010
"@math.gl/web-mercator": "^4.1.0",
11-
"@surbowl/world-geo-json-zh": "^2.1.5",
1211
"@svgr/plugin-svgo": "^8.1.0",
13-
"@vercel/analytics": "^0.1.11",
12+
"@vercel/analytics": "^2.0.1",
1413
"@vercel/speed-insights": "^1.0.12",
15-
"@vitejs/plugin-react": "^5.0.0",
16-
"gcoord": "^0.3.2",
17-
"geojson": "^0.5.0",
18-
"mapbox-gl": "^2.15.0",
19-
"prop-types": "^15.8.1",
14+
"@vitejs/plugin-react": "^6.0.1",
15+
"gcoord": "^1.0.7",
16+
"mapbox-gl": "^3.23.0",
2017
"rc-virtual-list": "^3.19.2",
21-
"react": "^18.2.0",
22-
"react-dom": "^18.2.0",
23-
"react-ga4": "^2.1.0",
24-
"react-helmet-async": "^2.0.5",
25-
"react-map-gl": "^7.1.6",
26-
"react-router-dom": "^6.15.0",
27-
"recharts": "^2.15.2",
28-
"vite": "^7.1.2",
29-
"vite-plugin-svgr": "^4.3.0",
30-
"vite-tsconfig-paths": "^5.1.4"
18+
"react": "^19.2.5",
19+
"react-dom": "^19.2.5",
20+
"react-ga4": "^3.0.1",
21+
"react-helmet-async": "^3.0.0",
22+
"react-map-gl": "^8.1.1",
23+
"react-router-dom": "^7.14.2",
24+
"recharts": "^3.8.1",
25+
"vite": "^8.0.10",
26+
"vite-plugin-svgr": "^5.2.0"
3127
},
3228
"license": "MIT",
3329
"private": true,
@@ -41,8 +37,8 @@
4137
"dev": "vite dev",
4238
"serve": "vite serve",
4339
"lint": "eslint src --ext .ts,.tsx --fix",
44-
"check": "prettier --check \"src/main.tsx\" \"src/**/*.{css,module.css,json,ts,tsx}\" \"*.{yaml,json,ts}\"",
45-
"format": "prettier --write \"src/main.tsx\" \"src/**/*.{css,module.css,json,ts,tsx}\" \"*.{yaml,json,ts}\"",
40+
"check": "prettier --check \"src/main.tsx\" \"src/**/*.{css,module.css,json,ts,tsx}\" \"*.{yaml,json,ts}\" \"assets/index.tsx\" \"eslint.config.mjs\"",
41+
"format": "prettier --write \"src/main.tsx\" \"src/**/*.{css,module.css,json,ts,tsx}\" \"*.{yaml,json,ts}\" \"assets/index.tsx\" \"eslint.config.mjs\"",
4642
"ci": "pnpm run format && pnpm run lint && pnpm run build"
4743
},
4844
"engineStrict": true,
@@ -55,31 +51,22 @@
5551
"url": "https://github.com/ben-29/workouts_page"
5652
},
5753
"devDependencies": {
58-
"@eslint/eslintrc": "^3.3.1",
59-
"@eslint/js": "^9.32.0",
60-
"@tailwindcss/vite": "^4.1.11",
61-
"@types/geojson": "^7946.0.14",
62-
"@types/mapbox__polyline": "^1.0.2",
63-
"@types/node": "^24.2.1",
64-
"@types/prop-types": "^15.7.15",
65-
"@types/react": "^19.1.10",
66-
"@types/react-dom": "^19.1.7",
67-
"@typescript-eslint/eslint-plugin": "^8.37.0",
68-
"@typescript-eslint/parser": "^8.37.0",
69-
"eslint": "^9.31.0",
70-
"eslint-config-prettier": "^10.1.5",
71-
"eslint-plugin-prettier": "^5.5.1",
72-
"eslint-plugin-react": "^7.37.5",
73-
"eslint-plugin-react-hooks": "^5.1.0",
74-
"globals": "^16.3.0",
75-
"prettier": "^3.2.5",
76-
"prettier-plugin-tailwindcss": "^0.5.13",
77-
"tailwindcss": "^4.1.10",
78-
"typescript": "^5.2.2"
79-
},
80-
"pnpm": {
81-
"overrides": {
82-
"@types/node": "^24.2.1"
83-
}
54+
"@eslint-react/eslint-plugin": "^5.7.0",
55+
"@eslint/js": "^10.0.1",
56+
"@tailwindcss/vite": "^4.2.4",
57+
"@types/geojson": "^7946.0.16",
58+
"@types/mapbox__polyline": "^1.0.5",
59+
"@types/node": "^25.6.0",
60+
"@types/react": "^19.2.14",
61+
"@types/react-dom": "^19.2.3",
62+
"@typescript-eslint/eslint-plugin": "^8.59.1",
63+
"@typescript-eslint/parser": "^8.59.1",
64+
"eslint": "^10.3.0",
65+
"eslint-plugin-react-hooks": "^7.1.1",
66+
"globals": "^17.6.0",
67+
"prettier": "^3.8.3",
68+
"prettier-plugin-tailwindcss": "^0.8.0",
69+
"tailwindcss": "^4.2.4",
70+
"typescript": "^6.0.3"
8471
}
8572
}

0 commit comments

Comments
 (0)