5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 05:30:22 +08:00

fix: fix website build and add taskfile (#2577)

* chore: update dependencies

* docs: update source documents

* chore: use Taskfile instead of scripts
This commit is contained in:
Misite Bao 2023-04-12 19:36:01 +08:00 committed by GitHub
parent fbe7d4de6b
commit 0f791c71f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 2610 additions and 15337 deletions

View File

@ -10,15 +10,22 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set node - name: Setup Nodejs
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: 16.x node-version: 18.x
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Sync Translated Documents - name: Sync Translated Documents
run: cd scripts && chmod 755 ./sync-translated-documents.sh && ./sync-translated-documents.sh
env: env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
working-directory: ./website
run: task crowdin:pull
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v4 uses: peter-evans/create-pull-request@v4

View File

@ -1,8 +1,9 @@
name: Push Checks name: Upload Source Documents
on: on:
push: push:
branches: [master] branches: [master]
workflow_dispatch:
jobs: jobs:
push_files_to_crowdin: push_files_to_crowdin:
@ -21,17 +22,20 @@ jobs:
website/**/*.md website/**/*.md
website/**/*.json website/**/*.json
- name: Set node - name: Setup Nodejs
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: 16.x node-version: 18.x
- name: Push files - name: Setup Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload source documents
if: steps.changed-files.outputs.any_changed == 'true' if: steps.changed-files.outputs.any_changed == 'true'
env: env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
run: | working-directory: ./website
cd website run: task crowdin:push
corepack enable
pnpm install
pnpm run crowdin push -b master

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
cd ../website
npx @crowdin/cli@latest pull -b master --export-only-approved

1
website/.gitignore vendored
View File

@ -6,6 +6,7 @@
# Generated files # Generated files
.docusaurus .docusaurus
.task
.cache-loader .cache-loader
# Misc # Misc

46
website/Taskfile.yml Normal file
View File

@ -0,0 +1,46 @@
# https://taskfile.dev
version: "3"
tasks:
install:
desc: Install Dependencies
aliases: [i]
cmds:
- corepack prepare pnpm@8.2.0 --activate
- pnpm install
sources:
- package.json
- pnpm-lock.yaml
default:
desc: Start Website
deps: [install]
aliases: [s, start]
cmds:
- npx docusaurus start
build:
desc: Build Website
deps: [install]
cmds:
- npx docusaurus build
preview:
desc: Preview Website
deps: [build]
aliases: [serve]
cmds:
- npx docusaurus serve
crowdin:push:
desc: Upload source files to Crowdin
deps: [install]
cmds:
- npx crowdin push -b master
crowdin:pull:
desc: Download approved translation files from Crowdin to local
deps: [install]
cmds:
- npx crowdin pull -b master --export-only-approved

View File

@ -32,7 +32,7 @@
}, },
"theme.ErrorPageContent.tryAgain": { "theme.ErrorPageContent.tryAgain": {
"message": "Try again", "message": "Try again",
"description": "The label of the button to try again when the page crashed" "description": "The label of the button to try again rendering when the React error boundary captures an error"
}, },
"theme.NotFound.title": { "theme.NotFound.title": {
"message": "Page Not Found", "message": "Page Not Found",
@ -419,5 +419,13 @@
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": { "theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "Toggle navigation bar", "message": "Toggle navigation bar",
"description": "The ARIA label for hamburger menu button of mobile navigation" "description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.NavBar.navAriaLabel": {
"message": "Main",
"description": "The ARIA label for the main navigation"
},
"theme.docs.sidebar.navAriaLabel": {
"message": "Docs sidebar",
"description": "The ARIA label for the sidebar navigation"
} }
} }

View File

@ -54,5 +54,9 @@
"link.item.label.Discord": { "link.item.label.Discord": {
"message": "Discord", "message": "Discord",
"description": "The label of footer link with label=Discord linking to https://discord.gg/JDdSxwjhGf" "description": "The label of footer link with label=Discord linking to https://discord.gg/JDdSxwjhGf"
},
"logo.alt": {
"message": "Wails Logo",
"description": "The alt text of footer logo"
} }
} }

View File

@ -38,5 +38,9 @@
"item.label.Code of Conduct": { "item.label.Code of Conduct": {
"message": "Code of Conduct", "message": "Code of Conduct",
"description": "Navbar item with label Code of Conduct" "description": "Navbar item with label Code of Conduct"
},
"logo.alt": {
"message": "Wails Logo",
"description": "The alt text of navbar logo"
} }
} }

12817
website/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,11 +15,15 @@
"crowdin": "crowdin", "crowdin": "crowdin",
"crowdin:sync": "docusaurus write-translations && crowdin upload && crowdin download" "crowdin:sync": "docusaurus write-translations && crowdin upload && crowdin download"
}, },
"engines": {
"node": ">=18.14.0",
"pnpm": ">=8.0.0"
},
"dependencies": { "dependencies": {
"@crowdin/crowdin-api-client": "^1.19.2", "@crowdin/crowdin-api-client": "^1.19.2",
"@docusaurus/core": "^2.1.0", "@docusaurus/core": "^2.4.0",
"@docusaurus/preset-classic": "^2.1.0", "@docusaurus/preset-classic": "^2.4.0",
"@docusaurus/theme-search-algolia": "^2.1.0", "@docusaurus/theme-search-algolia": "^2.4.0",
"@mdx-js/react": "^1.6.22", "@mdx-js/react": "^1.6.22",
"@swc/core": "^1.3.7", "@swc/core": "^1.3.7",
"clsx": "^1.2.1", "clsx": "^1.2.1",

File diff suppressed because it is too large Load Diff