mirror of
https://github.com/nonebot/nonebot2.git
synced 2026-07-23 16:52:46 +00:00
⬆️ Docs: 更新 docusaurus 3.10 (#4121)
This commit is contained in:
@@ -4,10 +4,12 @@ description: Setup Node
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: pnpm/action-setup@v4
|
||||
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: yarn
|
||||
cache: pnpm
|
||||
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: pnpm install --frozen-lockfile
|
||||
shell: bash
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
|
||||
- name: Commit and Push
|
||||
run: |
|
||||
yarn prettier
|
||||
pnpm prettier
|
||||
git config user.name noneflow[bot]
|
||||
git config user.email 129742071+noneflow[bot]@users.noreply.github.com
|
||||
git add .
|
||||
@@ -110,7 +110,7 @@ jobs:
|
||||
|
||||
- name: Build and Publish Doc Package
|
||||
run: |
|
||||
yarn build:plugin --out-dir ../packages/nonebot-plugin-docs/nonebot_plugin_docs/dist
|
||||
pnpm build:plugin --out-dir ../packages/nonebot-plugin-docs/nonebot_plugin_docs/dist
|
||||
cd packages/nonebot-plugin-docs/
|
||||
uv version ${{ steps.version.outputs.VERSION }}
|
||||
uv build
|
||||
|
||||
@@ -39,8 +39,8 @@ jobs:
|
||||
|
||||
- name: Archive Files
|
||||
run: |
|
||||
yarn archive $(uv version --short)
|
||||
yarn prettier
|
||||
pnpm archive $(uv version --short)
|
||||
pnpm prettier
|
||||
|
||||
- name: Push Tag
|
||||
run: |
|
||||
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
uses: ./.github/actions/build-api-doc
|
||||
|
||||
- name: Build Doc
|
||||
run: yarn build
|
||||
run: pnpm build
|
||||
|
||||
- name: Get Branch Name
|
||||
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
uses: ./.github/actions/build-api-doc
|
||||
|
||||
- name: Build Doc
|
||||
run: yarn build
|
||||
run: pnpm build
|
||||
|
||||
- name: Export Context
|
||||
run: |
|
||||
|
||||
+4
-4
@@ -20,7 +20,7 @@
|
||||
|
||||
NoneBot 使用 [uv](https://docs.astral.sh/uv/) 管理项目依赖,由于 pre-commit 也经其管理,所以在此一并说明。
|
||||
|
||||
下面的命令能在已安装 uv 和 yarn 的情况下帮你快速配置开发环境。
|
||||
下面的命令能在已安装 uv 和 pnpm 的情况下帮你快速配置开发环境。
|
||||
|
||||
```bash
|
||||
# 安装 python 依赖
|
||||
@@ -55,11 +55,11 @@ nonemoji commit [-e EMOJI] [-m MESSAGE] [-- ...]
|
||||
|
||||
NoneBot2 的文档使用 [docusaurus](https://docusaurus.io/),它有一些 [Markdown 特性](https://docusaurus.io/zh-CN/docs/markdown-features) 可能会帮助到你。
|
||||
|
||||
如果你需要在本地预览修改后的文档,可以使用 yarn 安装文档依赖后启动 dev server,如下所示:
|
||||
如果你需要在本地预览修改后的文档,可以使用 pnpm 安装文档依赖后启动 dev server,如下所示:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
yarn start
|
||||
pnpm install
|
||||
pnpm start
|
||||
```
|
||||
|
||||
NoneBot2 文档并没有具体的行文风格规范,但我们建议你尽量写得简单易懂。
|
||||
|
||||
+8
-11
@@ -1,19 +1,16 @@
|
||||
{
|
||||
"name": "root",
|
||||
"private": true,
|
||||
"packageManager": "yarn@1.22.22",
|
||||
"workspaces": [
|
||||
"website"
|
||||
],
|
||||
"packageManager": "pnpm@11.14.0",
|
||||
"scripts": {
|
||||
"archive": "yarn workspace nonebot docusaurus docs:version",
|
||||
"build": "yarn workspace nonebot build",
|
||||
"build:plugin": "cross-env BASE_URL='/website/' yarn workspace nonebot build",
|
||||
"start": "yarn workspace nonebot start",
|
||||
"serve": "yarn workspace nonebot serve",
|
||||
"clear": "yarn workspace nonebot clear",
|
||||
"archive": "pnpm --filter nonebot docusaurus docs:version",
|
||||
"build": "pnpm --filter nonebot build",
|
||||
"build:plugin": "cross-env BASE_URL='/website/' pnpm --filter nonebot build",
|
||||
"start": "pnpm --filter nonebot start",
|
||||
"serve": "pnpm --filter nonebot serve",
|
||||
"clear": "pnpm --filter nonebot clear",
|
||||
"prettier": "prettier --config ./.prettierrc --write \"./website/\"",
|
||||
"lint": "yarn lint:js && yarn lint:style",
|
||||
"lint": "pnpm lint:js && pnpm lint:style",
|
||||
"lint:js": "eslint --cache --report-unused-disable-directives \"**/*.{js,jsx,ts,tsx,mjs}\"",
|
||||
"lint:js:fix": "eslint --cache --report-unused-disable-directives --fix \"**/*.{js,jsx,ts,tsx,mjs}\"",
|
||||
"lint:style": "stylelint \"**/*.css\"",
|
||||
|
||||
Generated
+15803
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
nodeLinker: "hoisted"
|
||||
|
||||
packages:
|
||||
- "website"
|
||||
|
||||
allowBuilds:
|
||||
"@swc/core": false
|
||||
core-js: false
|
||||
core-js-pure: false
|
||||
# sharp@0.32 (required by @docusaurus/plugin-ideal-image) downloads libvips
|
||||
# in its install script and doesn't work without it
|
||||
sharp: true
|
||||
|
||||
minimumReleaseAgeExclude:
|
||||
- "@nullbot/*"
|
||||
@@ -10,4 +10,4 @@ nb-autodoc nonebot \
|
||||
-u nonebot.internal \
|
||||
-u nonebot.internal.*
|
||||
cp -r ./build/nonebot/* ./website/docs/api/
|
||||
yarn prettier
|
||||
pnpm prettier
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "Setting up dev environment"
|
||||
uv sync --all-extras && uv run pre-commit install && yarn install
|
||||
uv sync --all-extras && uv run pre-commit install && pnpm install
|
||||
|
||||
@@ -201,7 +201,6 @@ export default async function createConfigAsync() {
|
||||
projectName: "nonebot2", // Usually your repo name.
|
||||
|
||||
onBrokenLinks: "throw",
|
||||
onBrokenMarkdownLinks: "warn",
|
||||
|
||||
// Even if you don't use internalization, you can use this field to set useful
|
||||
// metadata like html lang. For example, if your site is Chinese, you may want
|
||||
@@ -299,7 +298,7 @@ export default async function createConfigAsync() {
|
||||
],
|
||||
|
||||
future: {
|
||||
experimental_faster: true,
|
||||
faster: true,
|
||||
v4: true,
|
||||
},
|
||||
|
||||
@@ -322,6 +321,9 @@ sidebar_custom_props:
|
||||
mdx1Compat: {
|
||||
headingIds: true,
|
||||
},
|
||||
hooks: {
|
||||
onBrokenMarkdownLinks: "warn",
|
||||
},
|
||||
},
|
||||
|
||||
themeConfig,
|
||||
|
||||
+10
-10
@@ -13,8 +13,8 @@
|
||||
"docusaurus": "docusaurus",
|
||||
"start": "docusaurus start --host 0.0.0.0 --port 3000",
|
||||
"build": "docusaurus build",
|
||||
"build:fast": "cross-env BUILD_FAST=true yarn build",
|
||||
"build:fast:rsdoctor": "cross-env BUILD_FAST=true RSDOCTOR=true yarn build",
|
||||
"build:fast": "cross-env BUILD_FAST=true pnpm build",
|
||||
"build:fast:rsdoctor": "cross-env BUILD_FAST=true RSDOCTOR=true pnpm build",
|
||||
"build:fast:profile": "cross-env BUILD_FAST=true node --cpu-prof --cpu-prof-dir .cpu-prof ./node_modules/.bin/docusaurus build",
|
||||
"swizzle": "docusaurus swizzle",
|
||||
"deploy": "docusaurus deploy",
|
||||
@@ -26,11 +26,11 @@
|
||||
"prettier": "prettier --config ../.prettierrc --write ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "^3.7.0",
|
||||
"@docusaurus/eslint-plugin": "3.7.0",
|
||||
"@docusaurus/core": "3.10.2",
|
||||
"@docusaurus/eslint-plugin": "3.10.2",
|
||||
"@mdx-js/react": "^3.0.0",
|
||||
"@nullbot/docusaurus-plugin-changelog": "^3.0.0",
|
||||
"@nullbot/docusaurus-preset-nonepress": "^3.0.0",
|
||||
"@nullbot/docusaurus-plugin-changelog": "^3.7.0",
|
||||
"@nullbot/docusaurus-preset-nonepress": "^3.7.0",
|
||||
"clsx": "^2.0.0",
|
||||
"copy-text-to-clipboard": "^3.2.0",
|
||||
"prism-react-renderer": "^2.3.0",
|
||||
@@ -40,9 +40,9 @@
|
||||
"react-use-pagination": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/faster": "^3.7.0",
|
||||
"@docusaurus/module-type-aliases": "^3.7.0",
|
||||
"@nullbot/docusaurus-tsconfig": "^3.0.0",
|
||||
"@docusaurus/faster": "3.10.2",
|
||||
"@docusaurus/module-type-aliases": "3.10.2",
|
||||
"@nullbot/docusaurus-tsconfig": "^3.7.0",
|
||||
"@types/react-color": "^3.0.10",
|
||||
"asciinema-player": "^3.5.0",
|
||||
"typescript": "~5.7.2"
|
||||
@@ -60,6 +60,6 @@
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0"
|
||||
"node": ">=20.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"noUnusedParameters": false,
|
||||
"importsNotUsedAsValues": "remove",
|
||||
|
||||
// This is important. We run `yarn tsc` in website so we can catch issues
|
||||
// This is important. We run `pnpm tsc` in website so we can catch issues
|
||||
// with our declaration files (mostly names that are forgotten to be
|
||||
// imported, invalid semantics...). Because we don't have end-to-end type
|
||||
// tests, removing this would make things much harder to catch.
|
||||
|
||||
Reference in New Issue
Block a user