chore: 🚀 调整workflows使用pnpm安装依赖

This commit is contained in:
xuqingkai 2024-01-07 01:33:01 +08:00
parent dd8bc003ee
commit b255a037d6
7 changed files with 27 additions and 16 deletions

View File

@ -37,10 +37,13 @@ jobs:
}' > .minicirc
fi
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Install pnpm
run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: "14.x"
node-version: '18'
cache: 'pnpm'
- name: upload

View File

@ -18,7 +18,9 @@ jobs:
registry-url: https://registry.npmjs.org
- name: Install Dependencies
run: pnpm
run: |
npm install pnpm -g
pnpm install
- name: Run Compiler
run: pnpm compiler

View File

@ -13,10 +13,13 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v2
- name: 设置 Node.js 18.x 环境
uses: actions/setup-node@v2
- name: Install pnpm
run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '18'
cache: 'pnpm'
- name: Install Dependencies and Build Docs
run: |

View File

@ -41,10 +41,13 @@ jobs:
}' > .minicirc
fi
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Install pnpm
run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: "14.x"
node-version: '18'
cache: 'pnpm'
- name: upload

View File

@ -4,11 +4,11 @@ import { useSidebar } from 'vitepress/dist/client/theme-default/composables/side
import { computed } from 'vue';
const { theme, frontmatter } = useData()
const { theme } = useData()
const { hasSidebar } = useSidebar()
const copyright = computed(()=>{
const isNetlify = location.href.includes('netlify')
const isNetlify = typeof window !== 'undefined' ? window.location.href.includes('netlify') : false
if (!isNetlify) {
return `${theme.value.footer.copyright} | <a style="text-decoration: none;" href="https://www.netlify.com">This site is powered by Netlify</a>`
}else{

View File

@ -4,8 +4,8 @@
<script setup lang="ts">
import { useRoute, useData } from 'vitepress';
import { computed, onMounted, ref, watch } from 'vue'
const baseUrl = process.env.NODE_ENV === 'production' ? `${location.origin}/demo/?timestamp=${new Date().getTime()}#/` : 'http://localhost:5173/demo/#/'
import { computed, watch } from 'vue'
const baseUrl = process.env.NODE_ENV === 'production' && typeof window !== 'undefined' ? `${window.location.origin}/demo/?timestamp=${new Date().getTime()}#/` : 'http://localhost:5173/demo/#/'
const route = useRoute()
const href = computed(() => {
const path = route.path

View File

@ -44,7 +44,7 @@ export default {
import { onBeforeMount, ref, watch } from 'vue'
import { COLLAPSE_KEY, type CollapseToggleAllOptions } from './types'
import { useChildren } from '../composables/useChildren'
import { isArray } from '../common/util'
import { isArray, isDef } from '../common/util'
interface Props {
customClass?: string
@ -137,7 +137,7 @@ const toggleAll = (options: boolean | CollapseToggleAllOptions = {}) => {
names.push(item.name || index)
}
} else {
if (expanded ?? !item.$.exposed.expanded.value) {
if (isDef(expanded) ? expanded : !item.$.exposed.expanded.value) {
names.push(item.name || index)
}
}