Skip to content

Commit

Permalink
Merge branch 'master' into discord-oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
mgkbadola authored Nov 12, 2024
2 parents 1a27913 + d5e3602 commit d0dc113
Show file tree
Hide file tree
Showing 20 changed files with 4,554 additions and 3,154 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
branches:
tags:
paths:
- ".github/workflows/ci-test-backend.yml"
- ".github/workflows/ci-backend.yml"
- "backend/**"
- "!backend/scripts/**"
- "!**.md"
pull_request:
types: [opened, reopened]
paths:
- ".github/workflows/ci-test-backend.yml"
- ".github/workflows/ci-backend.yml"
- "backend/**"
- "!backend/scripts/**"
- "!**.md"
Expand All @@ -33,6 +33,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: "1.23"
cache-dependency-path: backend

- name: test and build backend
run: |
Expand Down
21 changes: 9 additions & 12 deletions .github/workflows/ci-frontend-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,17 @@ jobs:
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 7
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
path: ${{ env.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
Expand Down Expand Up @@ -79,18 +78,17 @@ jobs:
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 7
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
path: ${{ env.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
Expand Down Expand Up @@ -123,18 +121,17 @@ jobs:
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 7
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
path: ${{ env.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
Expand Down
30 changes: 13 additions & 17 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,17 @@ jobs:
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 7
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
path: ${{ env.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
Expand Down Expand Up @@ -79,18 +78,17 @@ jobs:
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 7
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
path: ${{ env.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
Expand Down Expand Up @@ -123,18 +121,17 @@ jobs:
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 7
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
path: ${{ env.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
Expand All @@ -161,7 +158,7 @@ jobs:
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 7
version: 8
run_install: false

- name: Check bundle size
Expand Down Expand Up @@ -191,18 +188,17 @@ jobs:
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 7
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
path: ${{ env.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: build and deploy master image to ghcr.io and dockerhub
- name: build and deploy master image to ghcr.io
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_PACKAGE_TOKEN: ${{ secrets.PKG_TOKEN }}
Expand All @@ -44,10 +44,10 @@ jobs:
ref="$(echo ${GITHUB_REF} | cut -d'/' -f3)"
echo GITHUB_REF - $ref
echo ${GITHUB_PACKAGE_TOKEN} | docker login ghcr.io -u ${USERNAME} --password-stdin
docker buildx build --push --no-cache --platform linux/amd64,linux/arm/v7,linux/arm64 \
docker buildx build --push --no-cache --platform linux/amd64,linux/arm64 \
-t ghcr.io/umputun/remark42-site:${ref} .
- name: deploy tagged (latest) to ghcr.io and dockerhub
- name: deploy tagged (latest) to ghcr.io
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_PACKAGE_TOKEN: ${{ secrets.PKG_TOKEN }}
Expand All @@ -59,7 +59,7 @@ jobs:
ref="$(echo ${GITHUB_REF} | cut -d'/' -f3)"
echo "GITHUB_REF=$ref, GITHUB_SHA=${GITHUB_SHA}"
echo ${GITHUB_PACKAGE_TOKEN} | docker login ghcr.io -u ${USERNAME} --password-stdin
docker buildx build --push --no-cache --platform linux/amd64,linux/arm/v7,linux/arm64 \
docker buildx build --push --no-cache --platform linux/amd64,linux/arm64 \
-t ghcr.io/umputun/remark42-site:${ref} -t ghcr.io/umputun/remark42-site:latest .
- name: remote site deployment from master
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
push:
branches: [master]
paths:
- ".github/workflows/e2e-tests.yml"
- "frontend/apps/remark42/**"
- "frontend/e2e/**"
- "frontend/Dockerfile.e2e"

pull_request:
branches: [master]
paths:
- ".github/workflows/e2e-tests.yml"
- "frontend/apps/remark42/**"
- "frontend/e2e/**"
- "frontend/Dockerfile.e2e"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COPY ./frontend/apps/remark42/package.json /srv/frontend/apps/remark42/
RUN \
if [[ -z "$SKIP_FRONTEND_BUILD" || -z "$SKIP_FRONTEND_TEST" ]]; then \
apk add --no-cache --update git && \
npm i -g pnpm@7; \
npm i -g pnpm@8; \
fi

RUN --mount=type=cache,id=pnpm,target=/root/.pnpm-store/v3 \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /srv/frontend
COPY ./frontend/package.json ./frontend/pnpm-lock.yaml ./frontend/pnpm-workspace.yaml /srv/frontend/
COPY ./frontend/apps/remark42/package.json /srv/frontend/apps/remark42/package.json

RUN apk add --no-cache --update git && npm i -g pnpm@7
RUN apk add --no-cache --update git && npm i -g pnpm@8
RUN --mount=type=cache,id=pnpm,target=/root/.pnpm-store/v3 pnpm i

FROM frontend-deps AS build-frontend
Expand Down
2 changes: 1 addition & 1 deletion frontend/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# .husky/pre-commit

cd frontend
pnpm lint-staged
pnpm lint-staged || true
2 changes: 1 addition & 1 deletion frontend/Dockerfile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /frontend

COPY ./package.json ./pnpm-workspace.yaml ./pnpm-lock.yaml /frontend/
COPY ./e2e/package.json /frontend/e2e/
RUN corepack enable && corepack prepare pnpm@7.33.6 --activate && pnpm install
RUN corepack enable && corepack prepare pnpm@8 --activate && pnpm install

COPY ./e2e/playwright.config.ts /frontend/e2e/
COPY ./e2e/tests /frontend/e2e/tests/
Expand Down
5 changes: 3 additions & 2 deletions frontend/apps/remark42/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
"translation:check": "node ./tasks/checkTranslation.js"
},
"engines": {
"node": ">=16.15 <=17.*",
"pnpm": "7.*"
"node": ">=16.15 <=22.*",
"pnpm": "8.*"
},
"packageManager": "[email protected]",
"dependencies": {
"@github/markdown-toolbar-element": "^2.1.1",
"@github/text-expander-element": "^2.2.2",
Expand Down
6 changes: 3 additions & 3 deletions frontend/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"license": "MIT",
"devDependencies": {
"@playwright/test": "^1.25.0",
"@types/node": "^18.7.8",
"nanoid": "^4.0.0",
"@types/node": "^22.9.0",
"nanoid": "^5.0.8",
"playwright": "^1.25.0",
"ts-node": "^10.9.1",
"typescript": "^4.7.4"
"typescript": "^5.6.3"
}
}
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"type-check:api": "turbo run type-check --filter=@remark42/api",
"lint:api": "turbo run lint --filter=@remark42/api"
},
"packageManager": "[email protected]",
"devDependencies": {
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Implementation of API methods for Remark42

## Development

- If you don't have `pnpm` installed run `npm i -g pnpm@7`
- If you don't have `pnpm` installed run `npm i -g pnpm@8`
- Install dependencies `pnpm i`
- Run development mode with `pnpm run dev`
- Build lib with `pnpm run build`
Expand Down
25 changes: 13 additions & 12 deletions frontend/packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,23 @@
"type-check": "tsc --noEmit",
"lint-staged:lint": "eslint --fix --ext .cjs,.mjs,.ts"
},
"packageManager": "[email protected]",
"devDependencies": {
"@types/node": "^18.0.5",
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"@vitest/coverage-c8": "^0.22.1",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"jsdom": "^20.0.0",
"msw": "^0.44.1",
"@types/node": "^18.19.64",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.13.0",
"@vitest/coverage-v8": "^2.1.4",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"jsdom": "^25.0.1",
"msw": "^1.3.5",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"prettier": "^3.3.3",
"ts-node": "^10.9.1",
"tslib": "^2.4.0",
"typescript": "^4.7.4",
"vitest": "^0.22.1",
"typescript": "^4.9.5",
"vitest": "^2.1.4",
"whatwg-fetch": "^3.6.2"
},
"type": "module",
Expand Down
Loading

0 comments on commit d0dc113

Please sign in to comment.