chore: tweak

This commit is contained in:
pengzhanbo 2024-08-06 01:56:10 +08:00
parent bf65d79c50
commit 306f8ea03e
11 changed files with 587 additions and 448 deletions

View File

@ -1,6 +1,7 @@
import * as path from 'node:path'
import { type UserConfig, defineUserConfig } from 'vuepress'
import { viteBundler } from '@vuepress/bundler-vite'
import { addViteOptimizeDepsInclude, addViteSsrExternal } from '@vuepress/helper'
import { theme } from './theme.js'
export default defineUserConfig({
@ -21,6 +22,11 @@ export default defineUserConfig({
pagePatterns: ['**/*.md', '!**/*.snippet.md', '!.vuepress', '!node_modules'],
extendsBundlerOptions(bundlerOptions, app) {
addViteOptimizeDepsInclude(bundlerOptions, app, '@simonwep/pickr')
addViteSsrExternal(bundlerOptions, app, '@simonwep/pickr')
},
bundler: viteBundler(),
theme,

View File

@ -1,23 +1,20 @@
<script setup lang="ts">
import 'https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/pickr.es5.min.js'
import '@simonwep/pickr/dist/themes/nano.min.css'
import { onMounted, onUnmounted, ref, watch } from 'vue'
const emit = defineEmits<{ (e: 'update:modelValue', value: string): void }>()
// eslint-disable-next-line ts/no-namespace
declare namespace window {
const Pickr: any
}
const color = defineModel<string>('modelValue', { default: 'rgba(0,0,0,1)' })
const pickerEl = ref<HTMLDivElement>()
let picker: any
onMounted(() => {
onMounted(async () => {
if (!pickerEl.value || picker)
return
picker = window.Pickr.create({
const { default: Pickr } = await import('@simonwep/pickr')
picker = Pickr.create({
el: pickerEl.value,
theme: 'nano',
default: color.value,

View File

@ -8,11 +8,6 @@ readingTime: false
editLink: false
contributors: false
lastUpdated: false
head:
-
- link
- href: https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/themes/nano.min.css
rel: stylesheet
---
::: tip

View File

@ -12,14 +12,15 @@
"vuepress": "2.0.0-rc.14"
},
"dependencies": {
"@iconify/json": "^2.2.231",
"@iconify/json": "^2.2.234",
"@simonwep/pickr": "^1.9.1",
"@vuepress/bundler-vite": "2.0.0-rc.14",
"chart.js": "^4.4.3",
"echarts": "^5.5.1",
"flowchart.ts": "^3.0.0",
"http-server": "^14.1.1",
"mermaid": "^10.9.1",
"vue": "^3.4.34",
"vue": "^3.4.35",
"vuepress-theme-plume": "workspace:*"
},
"devDependencies": {

View File

@ -44,18 +44,18 @@
"@types/lodash.merge": "^4.6.9",
"@types/node": "20.12.10",
"@types/webpack-env": "^1.18.5",
"bumpp": "^9.4.1",
"bumpp": "^9.4.2",
"commitizen": "^4.3.0",
"conventional-changelog-cli": "^5.0.0",
"cpx2": "^7.0.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^9.8.0",
"husky": "^9.1.3",
"lint-staged": "^15.2.7",
"husky": "^9.1.4",
"lint-staged": "^15.2.8",
"rimraf": "^6.0.1",
"stylelint": "^16.7.0",
"stylelint": "^16.8.1",
"tsconfig-vuepress": "^4.5.0",
"tsup": "^8.2.3",
"tsup": "^8.2.4",
"typescript": "^5.5.4",
"wait-on": "^7.2.0"
},

View File

@ -40,7 +40,7 @@
"vuepress": "2.0.0-rc.14"
},
"dependencies": {
"vue": "^3.4.34"
"vue": "^3.4.35"
},
"publishConfig": {
"access": "public"

View File

@ -46,19 +46,19 @@
}
},
"dependencies": {
"@iconify/utils": "^2.1.25",
"@iconify/utils": "^2.1.30",
"@vuepress/helper": "2.0.0-rc.40",
"@vueuse/core": "^10.11.0",
"local-pkg": "^0.5.0",
"markdown-it-container": "^4.0.0",
"nanoid": "^5.0.7",
"shiki": "^1.12.0",
"tm-grammars": "^1.15.1",
"tm-themes": "^1.5.7",
"vue": "^3.4.34"
"shiki": "^1.12.1",
"tm-grammars": "^1.16.2",
"tm-themes": "^1.6.1",
"vue": "^3.4.35"
},
"devDependencies": {
"@iconify/json": "^2.2.231",
"@iconify/json": "^2.2.234",
"@types/markdown-it": "^14.1.2"
},
"publishConfig": {

View File

@ -48,7 +48,7 @@
"mark.js": "^8.11.1",
"minisearch": "^7.1.0",
"p-map": "^7.0.2",
"vue": "^3.4.34"
"vue": "^3.4.35"
},
"publishConfig": {
"access": "public"

View File

@ -36,8 +36,8 @@
"vuepress": "2.0.0-rc.14"
},
"dependencies": {
"@shikijs/transformers": "^1.12.0",
"@shikijs/twoslash": "^1.12.0",
"@shikijs/transformers": "^1.12.1",
"@shikijs/twoslash": "^1.12.1",
"@types/hast": "^3.0.4",
"@vuepress/helper": "2.0.0-rc.40",
"@vueuse/core": "^10.11.0",
@ -46,7 +46,7 @@
"mdast-util-gfm": "^3.0.0",
"mdast-util-to-hast": "^13.2.0",
"nanoid": "^5.0.7",
"shiki": "^1.12.0",
"shiki": "^1.12.1",
"twoslash": "^0.2.9",
"twoslash-vue": "^0.2.9"
},

966
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -71,7 +71,7 @@
}
},
"dependencies": {
"@iconify/utils": "^2.1.25",
"@iconify/utils": "^2.1.30",
"@iconify/vue": "^4.1.2",
"@pengzhanbo/utils": "^1.1.2",
"@vuepress-plume/plugin-content-update": "workspace:*",
@ -103,12 +103,12 @@
"katex": "^0.16.11",
"local-pkg": "^0.5.0",
"nanoid": "^5.0.7",
"vue": "^3.4.34",
"vue-router": "^4.4.0",
"vue": "^3.4.35",
"vue-router": "^4.4.2",
"vuepress-plugin-md-enhance": "2.0.0-rc.52",
"vuepress-plugin-md-power": "workspace:*"
},
"devDependencies": {
"@iconify/json": "^2.2.231"
"@iconify/json": "^2.2.234"
}
}