Skip to content

Commit b5a2a49

Browse files
committed
Merge branch 'fix_strava_sync'
# Conflicts: # .github/workflows/run_data_sync.yml # README-CN.md # README.md # assets/github.svg # assets/grid.svg # assets/mol.svg # assets/year_2012.svg # assets/year_2015.svg # assets/year_2018.svg # assets/year_2021.svg # assets/year_2022.svg # assets/year_2023.svg # package.json # pnpm-lock.yaml # requirements.txt # run_page/generator/db.py # run_page/keep_sync.py # src/components/ActivityList/index.tsx # src/components/ActivityList/style.module.css # src/components/Layout/style.module.css # src/components/RunMap/style.module.css # src/components/RunTable/index.tsx # src/components/RunTable/style.module.css # src/components/YearStat/index.tsx # src/components/YearsStat/index.tsx # src/hooks/useActivities.ts # src/pages/index.tsx # src/static/activities.json # src/utils/const.ts
2 parents e6f227c + 3f4481f commit b5a2a49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+6622
-5651
lines changed

.eslintignore

Lines changed: 0 additions & 15 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/run_data_sync.yml

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525

2626
env:
2727
# please change to your own config.
28-
RUN_TYPE: pass # support strava/nike/garmin/coros/garmin_cn/garmin_sync_cn_global/keep/only_gpx/only_fit/nike_to_strava/strava_to_garmin/tcx_to_garmin/strava_to_garmin_cn/garmin_to_strava/garmin_to_strava_cn/codoon/oppo/db_updater, Please change the 'pass' it to your own
28+
RUN_TYPE: pass # support strava/nike/garmin/coros/garmin_cn/garmin_sync_cn_global/keep/only_gpx/only_fit/nike_to_strava/strava_to_garmin/tcx_to_garmin/strava_to_garmin_cn/garmin_to_strava/garmin_to_strava_cn/oppo/db_updater, Please change the 'pass' it to your own
2929
ATHLETE: ben_29
3030
TITLE: Workouts
3131
MIN_GRID_DISTANCE: 10 # change min distance here
@@ -109,55 +109,44 @@ jobs:
109109
if: env.RUN_TYPE == 'coros'
110110
run: |
111111
python run_page/coros_sync.py ${{ secrets.COROS_ACCOUNT }} ${{ secrets.COROS_PASSWORD }}
112-
# If you only want to sync `type running` add args --only-run, default script is to sync all data (rides , swims, strengths trains, hikes, runs, etc.).
112+
# If you only want to sync 'type running' add args --only-run, default script is to sync all data (rides , swims, strengths trains, hikes, runs, etc.).
113113
# python run_page/coros_sync.py ${{ secrets.COROS_ACCOUNT }} ${{ secrets.COROS_PASSWORD }} --only-run
114114

115115
- name: Run sync Keep_to_strava script
116116
if: env.RUN_TYPE == 'keep_to_strava_sync'
117117
run: |
118118
python run_page/keep_to_strava_sync.py ${{ secrets.KEEP_MOBILE }} ${{ secrets.KEEP_PASSWORD }} ${{ secrets.STRAVA_CLIENT_ID }} ${{ secrets.STRAVA_CLIENT_SECRET }} ${{ secrets.STRAVA_CLIENT_REFRESH_TOKEN }} --sync-types running cycling hiking
119-
# If you only want to sync `type running` modify args --sync-types running, default script is to sync all data (rides, hikes and runs).
119+
# If you only want to sync 'type running' modify args --sync-types running, default script is to sync all data (rides, hikes and runs).
120120

121121
- name: Run sync Strava script
122122
if: env.RUN_TYPE == 'strava'
123123
run: |
124124
python run_page/strava_sync.py ${{ secrets.STRAVA_CLIENT_ID }} ${{ secrets.STRAVA_CLIENT_SECRET }} ${{ secrets.STRAVA_CLIENT_REFRESH_TOKEN }}
125-
# If you only want to sync `type running` add args --only-run, default script is to sync all data (rides and runs).
125+
# If you only want to sync 'type running' add args --only-run, default script is to sync all data (rides and runs).
126126

127-
- name: Run sync Codoon script
128-
if: env.RUN_TYPE == 'codoon'
129-
run: |
130-
python run_page/codoon_sync.py ${{ secrets.CODOON_MOBILE }} ${{ secrets.CODOON_PASSWORD }}
131-
132-
- name: Run sync tcx to Garmin script
133-
if: env.RUN_TYPE == 'tcx_to_garmin'
134-
run: |
135-
# python run_page/tcx_to_garmin_sync.py ${{ secrets.GARMIN_SECRET_STRING }}
136-
python run_page/tcx_to_garmin_sync.py ${{ secrets.GARMIN_SECRET_STRING_CN }} --is-cn
137-
138-
# for garmin if you want generate `tcx` you can add --tcx command in the args.
127+
# for garmin if you want generate 'tcx' you can add --tcx command in the args.
139128
- name: Run sync Garmin script
140129
if: env.RUN_TYPE == 'garmin'
141130
run: |
142-
# make garmin secret string `python run_page/get_garmin_secret.py ${email} ${password}
143131
python run_page/garmin_sync.py ${{ secrets.GARMIN_SECRET_STRING }}
144-
# If you only want to sync `type running` add args --only-run, default script is to sync all data (rides and runs).
132+
# make garmin secret string 'python run_page/get_garmin_secret.py ${email} ${password}'
133+
# If you only want to sync 'type running' add args --only-run, default script is to sync all data (rides and runs).
145134
# python run_page/garmin_sync.py ${{ secrets.GARMIN_SECRET_STRING }} --only-run
146135

147136
- name: Run sync Garmin CN script
148137
if: env.RUN_TYPE == 'garmin_cn'
149138
run: |
150-
# make garmin secret string `python run_page/get_garmin_secret.py ${email} ${password} --is-cn
151139
python run_page/garmin_sync.py ${{ secrets.GARMIN_SECRET_STRING_CN }} --is-cn
152-
# If you only want to sync `type running` add args --only-run, default script is to sync all data (rides and runs).
140+
# make garmin secret string 'python run_page/get_garmin_secret.py ${email} ${password} --is-cn'
141+
# If you only want to sync 'type running' add args --only-run, default script is to sync all data (rides and runs).
153142
# python run_page/garmin_sync.py ${{ secrets.GARMIN_SECRET_STRING_CN }} --only-run --is-cn
154143

155144
- name: Run sync Garmin CN to Garmin script
156145
if: env.RUN_TYPE == 'garmin_sync_cn_global'
157146
run: |
158-
# make garmin secret string `python run_page/garmin_sync_cn_global.py ${email} ${password} --is-cn
159147
python run_page/garmin_sync_cn_global.py ${{ secrets.GARMIN_SECRET_STRING_CN }} ${{ secrets.GARMIN_SECRET_STRING }}
160-
# If you only want to sync `type running` add args --only-run, default script is to sync all data (rides and runs).
148+
# make garmin secret string 'python run_page/garmin_sync_cn_global.py ${email} ${password} --is-cn'
149+
# If you only want to sync 'type running' add args --only-run, default script is to sync all data (rides and runs).
161150
# python run_page/garmin_sync_cn_global.py ${{ secrets.GARMIN_SECRET_STRING_CN }} ${{ secrets.GARMIN_SECRET_STRING }} --only-run
162151

163152
- name: Run sync Only GPX script
@@ -227,7 +216,13 @@ jobs:
227216
env:
228217
BIRTHDAY_MONTH: ${{ env.BIRTHDAY_MONTH }}
229218
run: |
230-
python run_page/gen_svg.py --from-db --type monthoflife --birth "${{env.BIRTHDAY_MONTH}}" --special-color '#f9d367' --special-color2 '#f0a1a8' --output assets/mol.svg --use-localtime --athlete "${{env.ATHLETE}}" --title 'Month of Life'
219+
python run_page/gen_svg.py --from-db --type monthoflife --birth "${{env.BIRTHDAY_MONTH}}" --special-color "#f9d367" --special-color2 "#f0a1a8" --output assets/mol_running.svg --use-localtime --athlete "${{env.ATHLETE}}" --title "Runner Month of Life" --sport-type running
220+
python run_page/gen_svg.py --from-db --type monthoflife --birth "${{env.BIRTHDAY_MONTH}}" --special-color "#f9d367" --special-color2 "#f0a1a8" --output assets/mol_walking.svg --use-localtime --athlete "${{env.ATHLETE}}" --title "Walker Month of Life" --sport-type walking
221+
python run_page/gen_svg.py --from-db --type monthoflife --birth "${{env.BIRTHDAY_MONTH}}" --special-color "#f9d367" --special-color2 "#f0a1a8" --output assets/mol_hiking.svg --use-localtime --athlete "${{env.ATHLETE}}" --title "Hiker Month of Life" --sport-type hiking
222+
python run_page/gen_svg.py --from-db --type monthoflife --birth "${{env.BIRTHDAY_MONTH}}" --special-color "#f9d367" --special-color2 "#f0a1a8" --output assets/mol_cycling.svg --use-localtime --athlete "${{env.ATHLETE}}" --title "Cyclist Month of Life" --sport-type cycling
223+
python run_page/gen_svg.py --from-db --type monthoflife --birth "${{env.BIRTHDAY_MONTH}}" --special-color "#f9d367" --special-color2 "#f0a1a8" --output assets/mol.svg --use-localtime --athlete "${{env.ATHLETE}}" --title "Month of Life" --sport-type all
224+
python run_page/gen_svg.py --from-db --type monthoflife --birth "${{env.BIRTHDAY_MONTH}}" --special-color "#f9d367" --special-color2 "#f0a1a8" --output assets/mol_swimming.svg --use-localtime --athlete "${{env.ATHLETE}}" --title "Swimmer Month of Life" --sport-type swimming
225+
python run_page/gen_svg.py --from-db --type monthoflife --birth "${{env.BIRTHDAY_MONTH}}" --special-color "#f9d367" --special-color2 "#f0a1a8" --output assets/mol_skiing.svg --use-localtime --athlete "${{env.ATHLETE}}" --title "Skier Month of Life" --sport-type skiing
231226
232227
- name: Save data to parqent
233228
if: env.SAVE_TO_PARQENT == 'true'
@@ -241,8 +236,8 @@ jobs:
241236
git config --local user.email "action@github.com"
242237
git config --local user.name "GitHub Action"
243238
git add .
244-
git commit -m 'Add new workouts' || echo "nothing to commit"
245-
git push || echo "nothing to push"
239+
git commit -m 'Add new workouts' || echo 'nothing to commit'
240+
git push || echo 'nothing to push'
246241
247242
- name: Set Output
248243
id: set_output

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ config.yaml
2424

2525
route.png
2626
route.svg
27+
28+
.env

assets/github_2025.svg

Lines changed: 1 addition & 1 deletion
Loading

assets/year_2025.svg

Lines changed: 1 addition & 1 deletion
Loading

eslint.config.cjs

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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');
7+
8+
module.exports = [
9+
js.configs.recommended,
10+
{
11+
files: ['**/*.{js,jsx,ts,tsx}'],
12+
languageOptions: {
13+
parser: tsParser,
14+
globals: {
15+
...globals.browser,
16+
NodeJS: true,
17+
},
18+
ecmaVersion: 'latest',
19+
sourceType: 'module',
20+
parserOptions: {
21+
ecmaFeatures: {
22+
jsx: true,
23+
},
24+
},
25+
},
26+
plugins: {
27+
'@typescript-eslint': tsPlugin,
28+
react,
29+
prettier,
30+
},
31+
settings: {
32+
react: {
33+
version: 'detect',
34+
},
35+
},
36+
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',
44+
'no-unused-vars': 'off',
45+
'@typescript-eslint/no-unused-vars': [
46+
'warn',
47+
{
48+
argsIgnorePattern: '^_',
49+
varsIgnorePattern: '^_',
50+
caughtErrorsIgnorePattern: '^_',
51+
destructuredArrayIgnorePattern: '^_',
52+
ignoreRestSiblings: true,
53+
},
54+
],
55+
},
56+
},
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+
},
75+
];

package.json

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,36 @@
1212
"@svgr/plugin-svgo": "^8.1.0",
1313
"@vercel/analytics": "^0.1.11",
1414
"@vercel/speed-insights": "^1.0.12",
15-
"@vitejs/plugin-react": "^4.0.4",
15+
"@vitejs/plugin-react": "^4.6.0",
1616
"gcoord": "^0.3.2",
1717
"geojson": "^0.5.0",
1818
"mapbox-gl": "^2.15.0",
1919
"prop-types": "^15.8.1",
2020
"react": "^18.2.0",
2121
"react-dom": "^18.2.0",
2222
"react-ga4": "^2.1.0",
23-
"react-helmet-async": "^1.3.0",
23+
"react-helmet-async": "^2.0.5",
2424
"react-map-gl": "^7.1.6",
2525
"react-router-dom": "^6.15.0",
2626
"recharts": "^2.15.2",
27-
"vite": "^4.4.9",
28-
"vite-plugin-svgr": "^3.2.0",
27+
"vite": "^5.4.19",
28+
"vite-plugin-svgr": "^4.3.0",
2929
"vite-tsconfig-paths": "^4.2.0"
3030
},
3131
"license": "MIT",
3232
"private": true,
3333
"type": "module",
3434
"scripts": {
3535
"data:clean": "rm -f run_page/data.db {GPX,TCX,FIT}_OUT/* activities/* src/static/activities.json",
36-
"clean": "rm -f run_page/data.db {GPX,TCX,FIT}_OUT/* activities/* src/static/activities.json",
3736
"data:download:garmin": "python3 run_page/garmin_sync.py",
3837
"data:analysis": "python3 run_page/gen_svg.py --from-db --type github --output assets/github.svg",
3938
"build": "vite build",
4039
"develop": "vite dev",
4140
"dev": "vite dev",
4241
"serve": "vite serve",
43-
"lint": "eslint --ext .ts,.tsx src --fix",
44-
"check": "prettier --check src/main.tsx src/**/*.{css,json,ts,tsx} *.{md,yaml,json,ts,js}",
45-
"format": "prettier --write src/main.tsx src/**/*.{css,json,ts,tsx} *.{md,yaml,json,ts,js}",
42+
"lint": "eslint src --ext .ts,.tsx --fix",
43+
"check": "prettier --check src/main.tsx src/**/*.{css,module.css,json,ts,tsx} *.{yaml,json,ts}",
44+
"format": "prettier --write src/main.tsx src/**/*.{css,module.css,json,ts,tsx} *.{yaml,json,ts}",
4645
"ci": "pnpm run format && pnpm run lint && pnpm run build"
4746
},
4847
"engineStrict": true,
@@ -55,23 +54,26 @@
5554
"url": "https://github.com/ben-29/workouts_page"
5655
},
5756
"devDependencies": {
58-
"@tailwindcss/postcss": "^4.1.8",
57+
"@eslint/eslintrc": "^3.3.1",
58+
"@eslint/js": "^9.32.0",
59+
"@tailwindcss/vite": "^4.1.10",
5960
"@types/geojson": "^7946.0.14",
6061
"@types/mapbox__polyline": "^1.0.2",
6162
"@types/node": "^20.5.7",
62-
"@types/prop-types": "^15.7.11",
63+
"@types/prop-types": "^15.7.15",
6364
"@types/react": "^18.2.21",
6465
"@types/react-dom": "^18.2.7",
65-
"@typescript-eslint/parser": "^5.62.0",
66-
"autoprefixer": "^10.4.19",
67-
"eslint": "^8.48.0",
68-
"eslint-config-prettier": "^8.10.0",
69-
"eslint-plugin-prettier": "^4.2.1",
70-
"eslint-plugin-react": "^7.33.2",
71-
"postcss": "^8.4.38",
66+
"@typescript-eslint/eslint-plugin": "^8.37.0",
67+
"@typescript-eslint/parser": "^8.37.0",
68+
"eslint": "^9.31.0",
69+
"eslint-config-prettier": "^10.1.5",
70+
"eslint-plugin-prettier": "^5.5.1",
71+
"eslint-plugin-react": "^7.37.5",
72+
"eslint-plugin-react-hooks": "^5.1.0",
73+
"globals": "^16.3.0",
7274
"prettier": "^3.2.5",
7375
"prettier-plugin-tailwindcss": "^0.5.13",
74-
"tailwindcss": "^4.1.8",
76+
"tailwindcss": "^4.1.10",
7577
"typescript": "^5.2.2"
7678
}
7779
}

0 commit comments

Comments
 (0)