Skip to content

Commit

Permalink
Merge branch 'refs/heads/upstream'
Browse files Browse the repository at this point in the history
* refs/heads/upstream:
  add keep2strava (yihong0618#653)
  Add data to 'running page runners' table (yihong0618#656)
  style: use Tailwind CSS (yihong0618#655)
  feat: fill country (yihong0618#654)
  docs: add runner (yihong0618#651)
  doc: add new runner
  docs: update README (yihong0618#650)
  docs: add a comment in `src/utils/consts.ts` to remind about security considerations regarding the `MAPBOX_TOKEN` (yihong0618#644)
  fix: no package manager
  fix: tachyons-sass import error (yihong0618#639)
  Update README.md (yihong0618#638)
  Add proxy config, add keep config, change npm registry, use yarn (yihong0618#634)
  chore: fix typo (yihong0618#633)

# Conflicts:
#	README-CN.md
#	README.md
#	pnpm-lock.yaml
#	src/components/Layout/style.module.scss
#	src/components/LocationStat/index.tsx
#	src/components/RunMap/index.tsx
#	src/components/RunMap/style.module.css
#	src/components/RunTable/RunRow.tsx
#	src/components/SVGStat/index.tsx
#	src/components/YearStat/index.tsx
#	src/styles/variables.scss
#	src/utils/const.ts
#	src/utils/utils.ts
  • Loading branch information
ben-29 committed Apr 21, 2024
2 parents a862ed5 + 5d84bd4 commit e38b63d
Show file tree
Hide file tree
Showing 42 changed files with 5,264 additions and 563 deletions.
File renamed without changes.
7 changes: 7 additions & 0 deletions .github/workflows/run_data_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- run_page/gpx_sync.py
- run_page/tcx_sync.py
- run_page/garmin_to_strava_sync.py
- run_page/keep_to_strava_sync.py
- requirements.txt

env:
Expand Down Expand Up @@ -103,6 +104,12 @@ jobs:
run: |
python run_page/coros_sync.py ${{ secrets.COROS_ACCOUNT }} ${{ secrets.COROS_PASSWORD }}
- name: Run sync Keep_to_strava script
if: env.RUN_TYPE == 'keep_to_strava_sync'
run: |
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
# If you only want to sync `type running` modify args --sync-types running, default script is to sync all data (rides, hikes and runs).

- name: Run sync Strava script
if: env.RUN_TYPE == 'strava'
run: |
Expand Down
1 change: 1 addition & 0 deletions .prettierrc.js → .prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ module.exports = {
semi: true,
bracketSpacing: true,
singleQuote: true,
plugins: ['prettier-plugin-tailwindcss']
};
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
FROM python:3.10.5-slim AS develop-py
WORKDIR /root/running_page
COPY ./requirements.txt /root/running_page/requirements.txt
# Add proxy for apt.
# ENV http_proxy http://ip_address:port
# ENV https_proxy http://ip_address:port
RUN apt-get update \
&& apt-get install -y --no-install-recommends git \
&& apt-get purge -y --auto-remove \
Expand All @@ -14,10 +17,10 @@ FROM node:18 AS develop-node
WORKDIR /root/running_page
COPY ./package.json /root/running_page/package.json
COPY ./pnpm-lock.yaml /root/running_page/pnpm-lock.yaml
RUN npm config set registry https://registry.npm.taobao.org \
RUN npm config rm proxy&&npm config set registry https://registry.npmjs.org/ \
&&npm install -g corepack \
&&corepack enable \
&&pnpm install
&&yarn install

FROM develop-py AS data
ARG app
Expand All @@ -27,6 +30,8 @@ ARG client_id
ARG client_secret
ARG refresh_token
ARG YOUR_NAME
ARG keep_phone_number
ARG keep_password

WORKDIR /root/running_page
COPY . /root/running_page/
Expand All @@ -43,6 +48,8 @@ RUN DUMMY=${DUMMY}; \
python3 run_page/strava_sync.py ${client_id} ${client_secret} ${refresh_token};\
elif [ "$app" = "Nike_to_Strava" ] ; then \
python3 run_page/nike_to_strava_sync.py ${nike_refresh_token} ${client_id} ${client_secret} ${refresh_token};\
elif [ "$app" = "Keep" ] ; then \
python3 run_page/keep_sync.py ${keep_phone_number} ${keep_password};\
else \
echo "Unknown app" ; \
fi
Expand All @@ -54,7 +61,7 @@ RUN python3 run_page/gen_svg.py --from-db --title "my running page" --type grid
FROM develop-node AS frontend-build
WORKDIR /root/running_page
COPY --from=data /root/running_page /root/running_page
RUN pnpm run build
RUN yarn run build

FROM nginx:alpine AS web
COPY --from=frontend-build /root/running_page/dist /usr/share/nginx/html/
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@
"react-helmet-async": "^1.3.0",
"react-map-gl": "^7.1.6",
"react-router-dom": "^6.15.0",
"sass": "^1.52.3",
"sass-mq": "^6.0.0",
"tachyons": "^4.12.0",
"tachyons-sass": "git+https://github.com/tachyons-css/tachyons-sass.git",
"viewport-mercator-project": "^7.0.4",
"vite": "^4.3.9",
"vite-plugin-svgr": "^3.2.0",
"vite-tsconfig-paths": "^4.2.0"
},
"license": "MIT",
"private": true,
"type": "module",
"scripts": {
"data:clean": "rm run_page/data.db {GPX,TCX,FIT}_OUT/* activities/* src/static/activities.json",
"data:download:garmin": "python3 run_page/garmin_sync.py",
Expand All @@ -39,7 +36,7 @@
"develop": "vite dev",
"serve": "vite serve",
"lint": "eslint --ext .ts,.tsx src --fix",
"check": "prettier --write src/main.tsx src/**/*.{scss,json,ts,tsx} *.{md,yaml,json,ts,js}",
"check": "prettier --write src/main.tsx src/**/*.{css,json,ts,tsx} *.{md,yaml,json,ts,js}",
"ci": "pnpm run check && pnpm run lint && pnpm run build"
},
"engineStrict": true,
Expand All @@ -59,12 +56,15 @@
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@typescript-eslint/parser": "^5.59.2",
"autoprefixer": "^10.4.19",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"prettier": "2.8.8",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.13",
"tailwindcss": "^3.4.3",
"typescript": "^5.1.6"
},
"packageManager": "yarn@1.22.22"
}
}
Loading

0 comments on commit e38b63d

Please sign in to comment.