diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8e964a4f..69d58fe5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -26,16 +26,13 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v4 - with: - version: 10 - name: Setup Node uses: actions/setup-node@v6 with: node-version-file: package.json check-latest: true - cache: 'pnpm' - package-manager-cache: false + cache: pnpm - name: Setup Pages uses: actions/configure-pages@v5 @@ -45,6 +42,7 @@ jobs: - name: Build with VitePress run: pnpm run docs:build + - name: Upload artifact uses: actions/upload-pages-artifact@v4 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5192ac0a..cb970309 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,38 +26,18 @@ jobs: git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' + - name: Setup pnpm + uses: pnpm/action-setup@v4 + - name: Setup Node uses: actions/setup-node@v6 with: node-version-file: package.json check-latest: true - #cache: yarn - package-manager-cache: false - - - name: Setup yarn - run: | - corepack enable - yarn set version stable + cache: pnpm - - name: Get yarn cachedir - id: yarn-cachedir - run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT - - name: Cache yarn - uses: actions/cache@v5 - with: - path: ${{ steps.yarn-cachedir.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies (yarn) - run: yarn install - - - name: Cache apt - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: clang-format-19 clang-tidy-19 - execute_install_scripts: true + - name: Install dependencies (pnpm) + run: pnpm install - name: Cpp Lint (clang-format & clang-tidy) uses: cpp-linter/cpp-linter-action@v2 @@ -66,16 +46,16 @@ jobs: with: style: file thread-comments: update - version: 19 + # version: 19 files-changed-only: false continue-on-error: true - name: ESLint (+vue +prettier +ts) - run: yarn run eslint --fix --ignore-pattern .gitignore + run: pnpm exec eslint --fix --ignore-pattern .gitignore continue-on-error: true - name: Prettier - run: yarn run prettier --write . + run: pnpm exec prettier --write . continue-on-error: true - name: Markdown Lint @@ -89,7 +69,6 @@ jobs: - name: Autocorrect Fix uses: huacnlee/autocorrect-action@v2 with: - use_npm: true args: --fix continue-on-error: true diff --git a/docs/.vitepress/nscfg.mts b/docs/.vitepress/nscfg.mts index 8d6d0497..bf643fb0 100644 --- a/docs/.vitepress/nscfg.mts +++ b/docs/.vitepress/nscfg.mts @@ -15,7 +15,7 @@ export const Nav: DefaultTheme.NavItem[] = [ { text: "组件展示", link: "/杂项/组件展示", - } + }, ]; export const Sidebar: DefaultTheme.Sidebar = { "/教程/正文/": [ diff --git a/docs/.vitepress/theme/components/CodeCompare.vue b/docs/.vitepress/theme/components/CodeCompare.vue index ea297b4c..5bfa9737 100644 --- a/docs/.vitepress/theme/components/CodeCompare.vue +++ b/docs/.vitepress/theme/components/CodeCompare.vue @@ -4,19 +4,19 @@ defineProps({ // 左侧标题,默认 "Bad" leftTitle: { type: String, - default: '错误写法 (Bad)' + default: "错误写法 (Bad)", }, // 右侧标题,默认 "Good" rightTitle: { type: String, - default: '正确写法 (Good)' + default: "正确写法 (Good)", }, // 是否为垂直布局(可选强制垂直) vertical: { type: Boolean, - default: false - } -}) + default: false, + }, +});