Skip to content

Commit

Permalink
refactor(ui/prettier): add prettier formatter (#829)
Browse files Browse the repository at this point in the history
* style: format ui

* chore: fix

* chore(test): tidy up test folder files (#828)

* test: update test

* chore: convert to a monorepo for test

* chore(fix/i18n): fix fr locale and format (#827)

* ignore api generated file

* ignore generated sidebar d.ts files

* update .prettierrc

* keep yaml file doubleQuote

---------

Co-authored-by: qwqcode <qwqcode@gmail.com>
Co-authored-by: qwqcode <22412567+qwqcode@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 8, 2024
1 parent f03ab5e commit 8719249
Show file tree
Hide file tree
Showing 201 changed files with 3,303 additions and 2,289 deletions.
8 changes: 4 additions & 4 deletions .circleci/conditional_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ executors:
- image: cimg/base:stable
node:
docker:
- image: 'cimg/node:20.12.1'
- image: "cimg/node:20.12.1"
go:
docker:
- image: cimg/go:1.22.1
Expand All @@ -29,11 +29,11 @@ jobs:
executor: go
working_directory: ~/go/src/github.com/ArtalkJS/Artalk
environment:
GO111MODULE: 'on'
GO111MODULE: "on"
steps:
- checkout
- run:
name: 'Print the Go version'
name: "Print the Go version"
command: >
go version
- restore_cache:
Expand All @@ -45,7 +45,7 @@ jobs:
- save_cache:
key: go-mod-1.22.1-{{ checksum "go.sum" }}
paths:
- '~/go/pkg/mod'
- "~/go/pkg/mod"
- run:
name: Run tests
command: |
Expand Down
4 changes: 1 addition & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ module.exports = {
settings: {
'import/resolver': {
typescript: {
project: ['ui/artalk/tsconfig.json'].map((p) =>
path.resolve(__dirname, p),
),
project: ['ui/artalk/tsconfig.json'].map((p) => path.resolve(__dirname, p)),
},
},
polyfills: ['AbortController'],
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/comment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
description: The content of comment

runs:
using: 'composite'
using: "composite"
steps:
- uses: actions/github-script@v7
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/chglog/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ info:
title: CHANGELOG
repository_url: https://github.com/ArtalkJS/Artalk
options:
tag_filter_pattern: '^v'
tag_filter_pattern: "^v"
sort: date
commits:
filters:
Expand Down
18 changes: 9 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ updates:
schedule:
interval: monthly
commit-message:
prefix: 'chore(deps/go): '
prefix: "chore(deps/go): "
groups:
deps:
patterns:
- '*'
- "*"
open-pull-requests-limit: 15

- package-ecosystem: npm
directory: /ui
schedule:
interval: monthly
commit-message:
prefix: 'chore(deps/ui): '
prefix: "chore(deps/ui): "
groups:
prod-deps:
dependency-type: production
Expand All @@ -35,33 +35,33 @@ updates:
schedule:
interval: monthly
commit-message:
prefix: 'chore(deps/docs): '
prefix: "chore(deps/docs): "
groups:
deps:
patterns:
- '*'
- "*"
open-pull-requests-limit: 15

- package-ecosystem: docker
directory: /
schedule:
interval: monthly
commit-message:
prefix: 'chore(deps/docker): '
prefix: "chore(deps/docker): "
groups:
deps:
patterns:
- '*'
- "*"
open-pull-requests-limit: 15

- package-ecosystem: github-actions
directory: /.github/workflows
schedule:
interval: monthly
commit-message:
prefix: 'chore(deps/ci): '
prefix: "chore(deps/ci): "
groups:
deps:
patterns:
- '*'
- "*"
open-pull-requests-limit: 15
6 changes: 3 additions & 3 deletions .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ run-name: Build Nightly

on:
schedule:
- cron: '0 10 * * *'
- cron: "0 10 * * *"
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run'
description: "Dry run"
type: boolean
default: true

Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
with:
node-version: 20.x
registry-url: https://registry.npmjs.org/
cache: 'pnpm'
cache: "pnpm"

- name: Get pnpm store directory
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-tagging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
type: number
outputs:
version:
description: 'Version'
description: "Version"
value: ${{ jobs.tagging.outputs.version }}

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
node-version: 20.x
registry-url: https://registry.npmjs.org/
cache: 'pnpm'
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ on:
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run'
description: "Dry run"
type: boolean
default: true
build_items:
description: 'Build items'
description: "Build items"
type: string
default: 'ui,app,docker'
default: "ui,app,docker"

jobs:
# Tag the release version code before building
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
branches:
- master
schedule:
- cron: '40 17 * * 4'
- cron: "40 17 * * 4"

jobs:
analyze:
Expand Down Expand Up @@ -74,4 +74,4 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{matrix.language}}'
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .github/workflows/docs-cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Docs CN Mirror Deploy

on:
push:
branches: ['master']
paths: ['docs/**']
branches: ["master"]
paths: ["docs/**"]

jobs:
deploy:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- major
required: true
dry_run:
description: 'Dry run?'
description: "Dry run?"
type: boolean
default: false

Expand Down Expand Up @@ -72,9 +72,9 @@ jobs:
uses: peter-evans/create-pull-request@v6
if: ${{ !inputs.dry_run }}
with:
branch: 'release/${{ env.VERSION }}'
commit-message: 'chore: release ${{ env.VERSION }}'
title: 'chore: release ${{ env.VERSION }}'
branch: "release/${{ env.VERSION }}"
commit-message: "chore: release ${{ env.VERSION }}"
title: "chore: release ${{ env.VERSION }}"
labels: release
body: |
## Release ${{ env.VERSION }} 📦🚀
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/repo-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
type: string
description: Event Type
required: true
default: ''
default: ""

jobs:
release:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Test Docs

on:
push:
branches: ['*', '!release/*', '!nightly']
paths: ['docs/**']
tags-ignore: ['v*']
branches: ["*", "!release/*", "!nightly"]
paths: ["docs/**"]
tags-ignore: ["v*"]
pull_request:
paths: ['docs/**']
branches: ['*', '!release/*', '!nightly']
paths: ["docs/**"]
branches: ["*", "!release/*", "!nightly"]

jobs:
test_docs:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Test Frontend

on:
push:
branches: ['*', '!release/*', '!nightly']
paths: ['ui/**']
tags-ignore: ['v*']
branches: ["*", "!release/*", "!nightly"]
paths: ["ui/**"]
tags-ignore: ["v*"]
pull_request:
paths: ['ui/**']
branches: ['*', '!release/*', '!nightly']
paths: ["ui/**"]
branches: ["*", "!release/*", "!nightly"]

jobs:
test_ui:
Expand Down Expand Up @@ -42,5 +42,5 @@ jobs:
run: pnpm test

# https://github.com/arethetypeswrong/arethetypeswrong.github.io
- name: 'arethetypeswrong test'
- name: "arethetypeswrong test"
run: pnpm -F artalk attw || true
22 changes: 11 additions & 11 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ builds:
env:
- CC=x86_64-linux-gnu-gcc
- CXX=x86_64-linux-gnu-g++
binary: '{{.ProjectName}}'
binary: "{{.ProjectName}}"
main: ./main.go
ldflags: &common_ldflags |
-X github.com/ArtalkJS/Artalk/internal/config.Version={{.Version}}
Expand All @@ -49,7 +49,7 @@ builds:
env:
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
binary: '{{.ProjectName}}'
binary: "{{.ProjectName}}"
main: ./main.go
ldflags: *common_ldflags

Expand All @@ -60,11 +60,11 @@ builds:
goarch:
- arm
goarm:
- '7'
- "7"
env:
- CC=arm-linux-gnueabihf-gcc
- CXX=arm-linux-gnueabihf-g++
binary: '{{.ProjectName}}'
binary: "{{.ProjectName}}"
main: ./main.go
ldflags: *common_ldflags

Expand All @@ -81,7 +81,7 @@ builds:
env:
- CC=o64-clang
- CXX=o64-clang++
binary: '{{.ProjectName}}'
binary: "{{.ProjectName}}"
main: ./main.go
ldflags: *common_ldflags

Expand All @@ -94,7 +94,7 @@ builds:
env:
- CC=oa64-clang
- CXX=oa64-clang++
binary: '{{.ProjectName}}'
binary: "{{.ProjectName}}"
main: ./main.go
ldflags: *common_ldflags

Expand All @@ -111,7 +111,7 @@ builds:
env:
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
binary: '{{.ProjectName}}'
binary: "{{.ProjectName}}"
main: ./main.go
ldflags: *common_ldflags
flags:
Expand All @@ -129,7 +129,7 @@ builds:
env:
- CC=/llvm-mingw/bin/aarch64-w64-mingw32-gcc
- CXX=/llvm-mingw/bin/aarch64-w64-mingw32-g++
binary: '{{.ProjectName}}'
binary: "{{.ProjectName}}"
main: ./main.go
ldflags: *common_ldflags
flags: *win_common_flags
Expand All @@ -144,7 +144,7 @@ archives:
- linux-arm7
- linux-arm64
- darwin-arm64
name_template: '{{.ProjectName}}_v{{.Version}}_{{.Os}}_{{.Arch}}{{.Arm}}'
name_template: "{{.ProjectName}}_v{{.Version}}_{{.Os}}_{{.Arch}}{{.Arm}}"
format: tar.gz
format_overrides:
- goos: windows
Expand All @@ -156,10 +156,10 @@ archives:
- artalk.yml

checksum:
name_template: 'checksums.txt'
name_template: "checksums.txt"

snapshot:
name_template: '{{.Version}}-SNAPSHOT-{{.ShortCommit}}'
name_template: "{{.Version}}-SNAPSHOT-{{.ShortCommit}}"

# changelog:
# sort: asc
Expand Down
10 changes: 9 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ CDN.html
internal/template/notify_tpl/default.html

# generated files
# @link https://github.com/prettier/prettier/issues/3634
pnpm-lock.yaml
**/auto-imports.d.ts
**/components.d.ts
**/typed-router.d.ts
ui/artalk/src/api/v2.ts
docs/swagger/swagger.json
docs/swagger/swagger.yaml
pnpm-lock.yaml
docs/**
ui/artalk-sidebar/src/lib/md5.js
ui/artalk/src/lib/detect.ts
Loading

0 comments on commit 8719249

Please sign in to comment.