From 64307fa3d9791c9d044a0fe299809bc992dc1d57 Mon Sep 17 00:00:00 2001 From: mrdrivingduck Date: Thu, 4 Apr 2024 23:47:35 +0800 Subject: [PATCH] docs: support pnpm and remove yarn support --- .github/workflows/docs-format-check.yml | 30 +- .github/workflows/docs.yml | 30 +- docs/.vuepress/components/ArticleInfo.vue | 10 +- docs/.vuepress/config.ts | 7 +- package.json | 17 +- pnpm-lock.yaml | 2739 +++++++++++++++++ yarn.lock | 3356 --------------------- 7 files changed, 2784 insertions(+), 3405 deletions(-) create mode 100644 pnpm-lock.yaml delete mode 100644 yarn.lock diff --git a/.github/workflows/docs-format-check.yml b/.github/workflows/docs-format-check.yml index 08cc79eabcb..7ff95084169 100644 --- a/.github/workflows/docs-format-check.yml +++ b/.github/workflows/docs-format-check.yml @@ -21,27 +21,21 @@ jobs: # fetch all commits to get last updated time or other git log info fetch-depth: 0 + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + # choose pnpm version to use + version: 8 + # install deps with pnpm + run_install: true + - name: Setup Node.js uses: actions/setup-node@v4 with: # choose node.js version to use - node-version: "16" - - # cache node_modules - - name: Cache dependencies - uses: actions/cache@v4 - id: yarn-cache - with: - path: | - **/node_modules - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - # install dependencies if the cache did not hit - - name: Install dependencies - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile + node-version: 20 + # cache deps for pnpm + cache: pnpm - name: Prettier check - run: npx prettier --check docs/ + run: pnpm prettier:check diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 71852c36cb5..066e29ce5ac 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -21,31 +21,25 @@ jobs: # fetch all commits to get last updated time or other git log info fetch-depth: 0 + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + # choose pnpm version to use + version: 8 + # install deps with pnpm + run_install: true + - name: Setup Node.js uses: actions/setup-node@v4 with: # choose node.js version to use - node-version: "16" - - # cache node_modules - - name: Cache dependencies - uses: actions/cache@v4 - id: yarn-cache - with: - path: | - **/node_modules - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - # install dependencies if the cache did not hit - - name: Install dependencies - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile + node-version: 20 + # cache deps for pnpm + cache: pnpm # run build script - name: Build VuePress site - run: yarn docs:build + run: pnpm docs:build # please check out the docs of the workflow for more details # @see https://github.com/crazy-max/ghaction-github-pages diff --git a/docs/.vuepress/components/ArticleInfo.vue b/docs/.vuepress/components/ArticleInfo.vue index e4ab2fad7b0..ece15e5b3c0 100644 --- a/docs/.vuepress/components/ArticleInfo.vue +++ b/docs/.vuepress/components/ArticleInfo.vue @@ -11,7 +11,7 @@ const { frontmatter } = toRefs(props);