Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用新的构建工具和改用yarn包管理加速构建 #52

Merged
merged 19 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache: yarn

- name: Install dependencies
run: |
npm ci
yarn

- name: generate contributors
run: |
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build check

on:
push:
branches-ignore:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
name: Build check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: |
yarn

- name: Build website
run: |
make build

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
build:
rm versions.json
cp versions.build.json versions.json
npm run build
yarn run build
17 changes: 10 additions & 7 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

```shell
# 安装依赖
npm ci
yarn

# 添加依赖(举例)
yarn add @docusaurus/theme-classic

# 运行
npm run start
yarn run start

# 构建
npm run build
yarn run build
```

## 多语言
Expand All @@ -27,10 +30,10 @@ mkdir -p i18n/en/docusaurus-plugin-content-docs-quick/current
cp -r quick/** i18n/en/docusaurus-plugin-content-docs-quick/current

# 创建多语言元数据
npm run write-translations -- --locale en
yarn run write-translations --locale en

# 指定i18n语言运行
npm run start -- --locale en
yarn run start --locale en

```

Expand All @@ -39,7 +42,7 @@ npm run start -- --locale en

创建新版本
```bash
npm run docusaurus docs:version v2.7.x
yarn run docusaurus docs:version v2.7.x
```


Expand All @@ -49,5 +52,5 @@ npm run docusaurus docs:version v2.7.x

```shell
# 因为插入的位置不同,我们使用 swizzle DocItem/Paginator来修改
npm run swizzle @docusaurus/theme-classic DocItem/Paginator -- --wrap --typescript
yarn run swizzle @docusaurus/theme-classic DocItem/Paginator --wrap --typescript
```
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

28 changes: 19 additions & 9 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const config: Config = {
},
},
},
// https://www.docusaurus.cn/blog/releases/3.6#docusaurus-faster
future: {
experimental_faster: true,
},
presets: [
[
'classic',
Expand Down Expand Up @@ -65,13 +69,19 @@ const config: Config = {
} satisfies Preset.Options,
],
],
plugins: [
require.resolve("docusaurus-plugin-image-zoom")
],
plugins: [require.resolve('docusaurus-plugin-image-zoom')],
themeConfig: {
metadata: [
{name: 'keywords', content: 'GoFrame, Go开发框架, Golang企业框架, 高性能Go框架, 微服务开发, 开箱即用组件, 数据校验, 跨平台支持, 开发文档, 社区支持'},
{name: 'description', content: 'GoFrame是一款高性能、模块化的Go语言企业级开发框架,提供丰富的组件支持,可快速构建稳定的Web应用和微服务。具备出色的跨平台兼容性和详尽的中文文档,支持团队高效开发与交付。'},
{
name: 'keywords',
content:
'GoFrame, Go开发框架, Golang企业框架, 高性能Go框架, 微服务开发, 开箱即用组件, 数据校验, 跨平台支持, 开发文档, 社区支持',
},
{
name: 'description',
content:
'GoFrame是一款高性能、模块化的Go语言企业级开发框架,提供丰富的组件支持,可快速构建稳定的Web应用和微服务。具备出色的跨平台兼容性和详尽的中文文档,支持团队高效开发与交付。',
},
],
colorMode: {
defaultMode: 'light',
Expand All @@ -84,9 +94,9 @@ const config: Config = {
// options you can specify via https://github.com/francoischalifour/medium-zoom#usage
background: {
light: 'rgb(255, 255, 255)',
dark: 'rgb(50, 50, 50)'
}
}
dark: 'rgb(50, 50, 50)',
},
},
},
navbar: {
title: '',
Expand Down Expand Up @@ -228,4 +238,4 @@ const config: Config = {
],
};

export default config;
export default config;
Loading