mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 13:02:04 +08:00
chore: add Prettier
as format tool (#2689)
This commit is contained in:
parent
84919468ba
commit
d3a4d89786
37
.github/workflows/format-markdown-files.yml
vendored
Normal file
37
.github/workflows/format-markdown-files.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
name: Format Markdown Files
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format_markdown_files:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.repository == 'wailsapp/wails'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Nodejs
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 18.x
|
||||||
|
|
||||||
|
- name: Install Task
|
||||||
|
uses: arduino/setup-task@v1
|
||||||
|
with:
|
||||||
|
version: 3.x
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Format All Markdown Files
|
||||||
|
run: task format-all-md
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
uses: peter-evans/create-pull-request@v4
|
||||||
|
with:
|
||||||
|
commit-message: "docs: format document"
|
||||||
|
title: "docs: format document"
|
||||||
|
body: "- [x] Format all Markdown(x) documents"
|
||||||
|
branch: chore/format-markdown-files
|
||||||
|
delete-branch: true
|
||||||
|
draft: false
|
3
.prettierignore
Normal file
3
.prettierignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
website
|
||||||
|
v2
|
||||||
|
v3
|
6
.prettierrc.yml
Normal file
6
.prettierrc.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
overrides:
|
||||||
|
- files:
|
||||||
|
- "**/*.md"
|
||||||
|
options:
|
||||||
|
printWidth: 80
|
||||||
|
proseWrap: always
|
@ -2,8 +2,19 @@
|
|||||||
|
|
||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
vars:
|
includes:
|
||||||
GREETING: Hello, World!
|
website:
|
||||||
|
taskfile: website
|
||||||
|
dir: website
|
||||||
|
|
||||||
|
v2:
|
||||||
|
taskfile: v2
|
||||||
|
dir: v2
|
||||||
|
optional: true
|
||||||
|
v3:
|
||||||
|
taskfile: v3
|
||||||
|
dir: v3
|
||||||
|
optional: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
contributors:check:
|
contributors:check:
|
||||||
@ -18,7 +29,19 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- npx -y all-contributors-cli generate
|
- npx -y all-contributors-cli generate
|
||||||
|
|
||||||
release:
|
format:md:
|
||||||
dir: v2/tools/release
|
|
||||||
cmds:
|
cmds:
|
||||||
- go run release.go {{.CLI_ARGS}}
|
- npx prettier --write "**/*.md"
|
||||||
|
|
||||||
|
format:
|
||||||
|
cmds:
|
||||||
|
- task: format:md
|
||||||
|
|
||||||
|
format-all-md:
|
||||||
|
cmds:
|
||||||
|
- task: format:md
|
||||||
|
- task: website:format:md
|
||||||
|
- task: v2:format:md
|
||||||
|
# - task: v2:website:format
|
||||||
|
- task: v3:format:md
|
||||||
|
# - task: v3:website:format:md
|
||||||
|
1
v2/.prettierignore
Normal file
1
v2/.prettierignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
website
|
6
v2/.prettierrc.yml
Normal file
6
v2/.prettierrc.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
overrides:
|
||||||
|
- files:
|
||||||
|
- "**/*.md"
|
||||||
|
options:
|
||||||
|
printWidth: 80
|
||||||
|
proseWrap: always
|
17
v2/Taskfile.yaml
Normal file
17
v2/Taskfile.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# https://taskfile.dev
|
||||||
|
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
release:
|
||||||
|
dir: tools/release
|
||||||
|
cmds:
|
||||||
|
- go run release.go {{.CLI_ARGS}}
|
||||||
|
|
||||||
|
format:md:
|
||||||
|
cmds:
|
||||||
|
- npx prettier --write "**/*.md"
|
||||||
|
|
||||||
|
format:
|
||||||
|
cmds:
|
||||||
|
- task: format:md
|
1
v3/.prettierignore
Normal file
1
v3/.prettierignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
website
|
6
v3/.prettierrc.yml
Normal file
6
v3/.prettierrc.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
overrides:
|
||||||
|
- files:
|
||||||
|
- "**/*.md"
|
||||||
|
options:
|
||||||
|
printWidth: 80
|
||||||
|
proseWrap: always
|
@ -1,9 +1,14 @@
|
|||||||
# https://taskfile.dev
|
# https://taskfile.dev
|
||||||
|
|
||||||
version: '3'
|
version: "3"
|
||||||
|
|
||||||
|
includes:
|
||||||
|
website:
|
||||||
|
taskfile: ./website
|
||||||
|
dir: ./website
|
||||||
|
optional: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
build-runtime-debug:
|
build-runtime-debug:
|
||||||
dir: internal/runtime
|
dir: internal/runtime
|
||||||
internal: true
|
internal: true
|
||||||
@ -78,7 +83,6 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- npm install
|
- npm install
|
||||||
|
|
||||||
|
|
||||||
install-runtime-deps:
|
install-runtime-deps:
|
||||||
dir: internal/runtime
|
dir: internal/runtime
|
||||||
internal: true
|
internal: true
|
||||||
@ -200,3 +204,11 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- task: reinstall-cli
|
- task: reinstall-cli
|
||||||
- echo "Generated templates"
|
- echo "Generated templates"
|
||||||
|
|
||||||
|
format:md:
|
||||||
|
cmds:
|
||||||
|
- npx prettier --write "**/*.md"
|
||||||
|
|
||||||
|
format:
|
||||||
|
cmds:
|
||||||
|
- task: format:md
|
||||||
|
2
website/.prettierignore
Normal file
2
website/.prettierignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
i18n
|
||||||
|
versioned_docs
|
@ -45,3 +45,11 @@ tasks:
|
|||||||
deps: [install]
|
deps: [install]
|
||||||
cmds:
|
cmds:
|
||||||
- npx crowdin pull -b v2 --export-only-approved
|
- npx crowdin pull -b v2 --export-only-approved
|
||||||
|
|
||||||
|
format:md:
|
||||||
|
cmds:
|
||||||
|
- npx prettier --write "**/*.{md,mdx}"
|
||||||
|
|
||||||
|
format:
|
||||||
|
cmds:
|
||||||
|
- task: format:md
|
||||||
|
11
website/prettier.config.js
Normal file
11
website/prettier.config.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
module.exports = {
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: "**/*.{md,mdx}",
|
||||||
|
options: {
|
||||||
|
printWidth: 80,
|
||||||
|
proseWrap: "always",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user