chore: tweak

This commit is contained in:
pengzhanbo 2024-09-23 23:47:45 +08:00
parent 1e779a7b86
commit e421cb6dc3
13 changed files with 1684 additions and 2237 deletions

View File

@ -66,6 +66,9 @@ export async function createPackageJson(
if (bundler === 'webpack' && !pkg.dependencies?.['sass-loader'] && !pkg.devDependencies['sass-loader'])
deps.push('sass-loader')
if (!pkg.dependencies?.['sass-embedded'] && !pkg.devDependencies['sass-embedded'])
deps.push('sass-embedded')
const dv = await getDependenciesVersion(deps)
for (const [d, v] of Object.entries(dv))

View File

@ -12,7 +12,7 @@
"vuepress": "2.0.0-rc.15"
},
"dependencies": {
"@iconify/json": "^2.2.251",
"@iconify/json": "^2.2.252",
"@simonwep/pickr": "^1.9.1",
"@vuepress/bundler-vite": "2.0.0-rc.15",
"chart.js": "^4.4.4",
@ -20,8 +20,9 @@
"flowchart.ts": "^3.0.1",
"http-server": "^14.1.1",
"mermaid": "^11.2.1",
"sass-embedded": "^1.79.3",
"swiper": "^11.1.14",
"vue": "^3.5.7",
"vue": "^3.5.8",
"vuepress-theme-plume": "workspace:*"
},
"devDependencies": {

View File

@ -40,7 +40,7 @@
"vuepress": "2.0.0-rc.15"
},
"dependencies": {
"vue": "^3.5.7"
"vue": "^3.5.8"
},
"publishConfig": {
"access": "public"

View File

@ -41,15 +41,15 @@
},
"dependencies": {
"@mdit/plugin-tab": "^0.13.1",
"@vuepress/helper": "2.0.0-rc.46",
"@vuepress/helper": "2.0.0-rc.47",
"@vueuse/core": "^11.1.0",
"image-size": "^1.1.1",
"markdown-it-container": "^4.0.0",
"nanoid": "^5.0.7",
"shiki": "^1.18.0",
"tm-grammars": "^1.17.24",
"tm-themes": "^1.8.3",
"vue": "^3.5.7"
"tm-themes": "^1.8.4",
"vue": "^3.5.8"
},
"devDependencies": {
"@types/markdown-it": "^14.1.2"

View File

@ -40,7 +40,7 @@
"vuepress": "2.0.0-rc.15"
},
"dependencies": {
"@vuepress/helper": "2.0.0-rc.46",
"@vuepress/helper": "2.0.0-rc.47",
"@vueuse/core": "^11.1.0",
"@vueuse/integrations": "^11.1.0",
"chokidar": "3.6.0",
@ -48,7 +48,7 @@
"mark.js": "^8.11.1",
"minisearch": "^7.1.0",
"p-map": "^7.0.2",
"vue": "^3.5.7"
"vue": "^3.5.8"
},
"publishConfig": {
"access": "public"

View File

@ -39,7 +39,7 @@
"@shikijs/transformers": "^1.18.0",
"@shikijs/twoslash": "^1.18.0",
"@types/hast": "^3.0.4",
"@vuepress/helper": "2.0.0-rc.46",
"@vuepress/helper": "2.0.0-rc.47",
"@vueuse/core": "^11.1.0",
"floating-vue": "^5.2.2",
"mdast-util-from-markdown": "^2.0.1",

3788
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -90,40 +90,40 @@
"@vuepress-plume/plugin-fonts": "workspace:*",
"@vuepress-plume/plugin-search": "workspace:*",
"@vuepress-plume/plugin-shikiji": "workspace:*",
"@vuepress/helper": "2.0.0-rc.46",
"@vuepress/plugin-active-header-links": "2.0.0-rc.46",
"@vuepress/helper": "2.0.0-rc.47",
"@vuepress/plugin-active-header-links": "2.0.0-rc.47",
"@vuepress/plugin-cache": "2.0.0-rc.42",
"@vuepress/plugin-comment": "2.0.0-rc.46",
"@vuepress/plugin-docsearch": "2.0.0-rc.46",
"@vuepress/plugin-comment": "2.0.0-rc.47",
"@vuepress/plugin-docsearch": "2.0.0-rc.47",
"@vuepress/plugin-git": "2.0.0-rc.44",
"@vuepress/plugin-markdown-container": "2.0.0-rc.43",
"@vuepress/plugin-markdown-hint": "2.0.0-rc.46",
"@vuepress/plugin-markdown-image": "2.0.0-rc.46",
"@vuepress/plugin-markdown-math": "2.0.0-rc.46",
"@vuepress/plugin-nprogress": "2.0.0-rc.46",
"@vuepress/plugin-photo-swipe": "2.0.0-rc.46",
"@vuepress/plugin-reading-time": "2.0.0-rc.46",
"@vuepress/plugin-seo": "2.0.0-rc.46",
"@vuepress/plugin-sitemap": "2.0.0-rc.46",
"@vuepress/plugin-watermark": "2.0.0-rc.46",
"@vuepress/plugin-markdown-hint": "2.0.0-rc.47",
"@vuepress/plugin-markdown-image": "2.0.0-rc.47",
"@vuepress/plugin-markdown-math": "2.0.0-rc.49",
"@vuepress/plugin-nprogress": "2.0.0-rc.47",
"@vuepress/plugin-photo-swipe": "2.0.0-rc.47",
"@vuepress/plugin-reading-time": "2.0.0-rc.47",
"@vuepress/plugin-seo": "2.0.0-rc.47",
"@vuepress/plugin-sitemap": "2.0.0-rc.47",
"@vuepress/plugin-watermark": "2.0.0-rc.47",
"@vueuse/core": "^11.1.0",
"bcrypt-ts": "^5.0.2",
"chokidar": "3.6.0",
"create-filter": "^1.1.0",
"date-fns": "^4.1.0",
"esbuild": "^0.23.1",
"esbuild": "^0.24.0",
"fast-glob": "^3.3.2",
"gray-matter": "^4.0.3",
"json2yaml": "^1.1.0",
"katex": "^0.16.11",
"local-pkg": "^0.5.0",
"nanoid": "^5.0.7",
"vue": "^3.5.7",
"vuepress-plugin-md-enhance": "2.0.0-rc.52",
"vue": "^3.5.8",
"vuepress-plugin-md-enhance": "2.0.0-rc.54",
"vuepress-plugin-md-power": "workspace:*"
},
"devDependencies": {
"@iconify/json": "^2.2.251",
"@iconify/json": "^2.2.252",
"swiper": "^11.1.14",
"vue-router": "^4.4.5"
}

View File

@ -34,7 +34,7 @@ export function extendsBundlerOptions(bundlerOptions: any, app: App): void {
.rule('scss')
.use('sass-loader')
.tap((options: any) => ({
api: 'modern-compiler',
// api: 'modern-compiler',
...options,
sassOptions: {
silenceDeprecations: ['mixed-decls'],
@ -47,25 +47,27 @@ export function extendsBundlerOptions(bundlerOptions: any, app: App): void {
css: {
preprocessorOptions: {
sass: {
logger: {
warn: (message, { deprecation, deprecationType }) => {
if (deprecation && deprecationType.id === 'mixed-decls')
return
silenceDeprecations: ['mixed-decls'],
// logger: {
// warn: (message, { deprecation, deprecationType }) => {
// if (deprecation && deprecationType.id === 'mixed-decls')
// return
console.warn(message)
},
},
// console.warn(message)
// },
// },
},
scss: {
logger: {
warn: (message, { deprecation, deprecationType }) => {
if (deprecation && deprecationType.id === 'mixed-decls')
return
if (!message.includes('repetitive deprecation warnings omitted')) {
console.warn(message)
}
},
},
silenceDeprecations: ['mixed-decls'],
// logger: {
// warn: (message, { deprecation, deprecationType }) => {
// if (deprecation && deprecationType.id === 'mixed-decls')
// return
// if (!message.includes('repetitive deprecation warnings omitted')) {
// console.warn(message)
// }
// },
// },
},
},
},

View File

@ -18,7 +18,6 @@ export function resolvePageHead(page: Page, localeOptions: PlumeThemeLocaleOptio
const sm = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const isDark = um === 'dark' || (um !== 'light' && sm);
document.documentElement.dataset.theme = isDark ? 'dark' : 'light';
}
})();`.replace(/^\s+|\s+$/gm, '').replace(/\n/g, ''),
])
}

View File

@ -24,6 +24,7 @@ import {
resolveDocsearchOptions,
resolveSearchOptions,
} from '../config/index.js'
import { deleteAttrs } from '../utils/index.js'
import { customContainerPlugins } from './containerPlugins.js'
import { markdownTitlePlugin } from './markdown-title.js'
@ -111,21 +112,17 @@ export function getPlugins({
}
if (pluginOptions.markdownEnhance !== false) {
plugins.push(mdEnhancePlugin(
Object.assign(
{
attrs: true,
align: true,
mark: true,
tasklist: true,
sup: true,
sub: true,
footnote: true,
} as MarkdownEnhancePluginOptions,
pluginOptions.markdownEnhance || {},
{ hint: false, alert: false, imgSize: false, imgLazyload: false, imgMark: false, figure: false, obsidianImgSize: false, katex: false, mathjax: false, tabs: false, codetabs: false } as MarkdownEnhancePluginOptions,
),
))
const options: MarkdownEnhancePluginOptions = {
attrs: true,
align: true,
mark: true,
tasklist: true,
sup: true,
sub: true,
footnote: true,
...pluginOptions.markdownEnhance,
}
plugins.push(mdEnhancePlugin(deleteAttrs(options, 'hint', 'alert', 'imgSize', 'imgLazyload', 'imgMark', 'figure', 'obsidianImgSize', 'katex', 'mathjax', 'tabs', 'codetabs')))
}
if (pluginOptions.markdownPower !== false) {

View File

@ -0,0 +1,12 @@
export function deleteAttrs<
T extends Record<string, any> = Record<string, any>,
>(obj: T, ...attrs: (keyof T)[]): Omit<T, keyof T> {
const res = {} as T
for (const key in obj) {
if (!attrs.includes(key)) {
res[key] = obj[key]
}
}
return res
}

View File

@ -4,6 +4,7 @@ export const THEME_NAME = 'vuepress-theme-plume'
export const logger = new Logger(THEME_NAME)
export * from './deleteAttrs.js'
export * from './hash.js'
export * from './interopDefault.js'
export * from './package.js'