Skip to content

Commit

Permalink
feat: bump deps and avoid using @import
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Oct 21, 2024
1 parent 2feb22a commit b27c7ac
Show file tree
Hide file tree
Showing 55 changed files with 811 additions and 769 deletions.
2 changes: 2 additions & 0 deletions .stylelintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ rules:
declaration-block-no-redundant-longhand-properties: true
media-feature-range-notation: prefix
no-descending-specificity: null
# workaround for mixed-declarations
no-duplicate-selectors: null

overrides:
- files:
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@vuepress/theme-default": "workspace:*",
"katex": "0.16.11",
"mathjax-full": "3.2.2",
"sass-embedded": "1.79.5",
"sass-embedded": "1.80.3",
"sass-loader": "^16.0.2",
"vue": "^3.5.12",
"vuepress": "2.0.0-rc.18"
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/development/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Import the plugin's palette file where your theme needs to use the corresponding
<style lang="scss">
/* import variables from the plugin's palette file */
@import '@vuepress/plugin-palette/palette';
@use '@vuepress/plugin-palette/palette' as *;
/* set default value for variables */
$color: red !default;
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/plugins/development/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
<style lang="scss">
/* 从该插件的调色板中引入变量 */
@import '@vuepress/plugin-palette/palette';
@use '@vuepress/plugin-palette/palette' as *;
/* 设置变量的默认值 */
$color: red !default;
Expand Down
5 changes: 4 additions & 1 deletion e2e/docs/.vuepress/components/ArticleList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ defineProps<{
.article-wrapper {
@include mixins.content-wrapper;
text-align: center;
& {
text-align: center;
}
}
.article {
Expand Down
8 changes: 5 additions & 3 deletions e2e/docs/.vuepress/layouts/Category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ const categoryMap = useBlogCategory<ArticleInfo>('category')
.category-wrapper {
@include mixins.content-wrapper;
padding-top: 1rem !important;
padding-bottom: 0 !important;
font-size: 14px;
& {
padding-top: 1rem !important;
padding-bottom: 0 !important;
font-size: 14px;
}
a {
color: inherit;
Expand Down
8 changes: 5 additions & 3 deletions e2e/docs/.vuepress/layouts/Tag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ const tagMap = useBlogCategory<ArticleInfo>('tag')
.tag-wrapper {
@include mixins.content-wrapper;
padding-top: 1rem !important;
padding-bottom: 0 !important;
font-size: 14px;
& {
padding-top: 1rem !important;
padding-bottom: 0 !important;
font-size: 14px;
}
a {
color: inherit;
Expand Down
4 changes: 2 additions & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"@vuepress/plugin-theme-data": "workspace:*",
"@vuepress/plugin-watermark": "workspace:*",
"@vuepress/theme-default": "workspace:*",
"sass-embedded": "1.79.5",
"sass-embedded": "1.80.3",
"sass-loader": "^16.0.2",
"vue": "^3.5.12",
"vuepress": "2.0.0-rc.18"
},
"devDependencies": {
"@playwright/test": "^1.48.0"
"@playwright/test": "^1.48.1"
}
}
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@
"devDependencies": {
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@lerna-lite/cli": "^3.9.3",
"@lerna-lite/publish": "^3.9.3",
"@rollup/plugin-commonjs": "^28.0.0",
"@lerna-lite/cli": "^3.10.0",
"@lerna-lite/publish": "^3.10.0",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-node-resolve": "^15.3.0",
"@types/node": "^22.7.5",
"@types/node": "^22.7.7",
"@types/webpack-env": "^1.18.5",
"@vitest/coverage-istanbul": "^2.1.2",
"@vitest/coverage-istanbul": "^2.1.3",
"conventional-changelog-cli": "^5.0.0",
"cpx2": "^8.0.0",
"cross-env": "^7.0.3",
"eslint": "^9.12.0",
"eslint-config-vuepress": "^5.2.0",
"eslint": "^9.13.0",
"eslint-config-vuepress": "^5.2.1",
"http-server": "^14.1.1",
"husky": "^9.1.6",
"nano-staged": "^0.8.0",
Expand All @@ -56,19 +56,19 @@
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-resolve-shebang": "^1.0.1",
"sass-embedded": "1.79.5",
"sass-embedded": "^1.80.3",
"sort-package-json": "^2.10.1",
"stylelint": "^16.10.0",
"stylelint-config-hope": "^7.0.2",
"stylelint-config-hope": "^7.0.4",
"stylelint-config-html": "^1.1.0",
"tsconfig-vuepress": "^5.2.0",
"tsconfig-vuepress": "^5.2.1",
"tsx": "^4.19.1",
"typescript": "^5.6.3",
"vite": "~5.4.8",
"vitest": "^2.1.2",
"vite": "~5.4.9",
"vitest": "^2.1.3",
"vuepress": "2.0.0-rc.18"
},
"packageManager": "pnpm@9.12.1",
"packageManager": "pnpm@9.12.2",
"engines": {
"node": ">=18.19.0"
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/development/plugin-git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"clean": "rimraf --glob ./lib ./*.tsbuildinfo"
},
"dependencies": {
"execa": "^9.4.0"
"execa": "^9.4.1"
},
"peerDependencies": {
"vuepress": "2.0.0-rc.18"
Expand Down
24 changes: 13 additions & 11 deletions plugins/development/plugin-palette/src/node/palettePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,21 @@ export const palettePlugin = ({
}),

extendsBundlerOptions: (bundlerOptions: unknown, app): void => {
// switch to modern api for vite
addViteConfig(bundlerOptions, app, {
css: {
preprocessorOptions: {
sass: {
api: 'modern',
},
scss: {
api: 'modern',
if (preset === 'sass') {
// switch to modern api for vite
addViteConfig(bundlerOptions, app, {
css: {
preprocessorOptions: {
sass: {
api: 'modern',
},
scss: {
api: 'modern',
},
},
},
},
})
})
}
},

onPrepared: async (app) => {
Expand Down
6 changes: 3 additions & 3 deletions plugins/development/plugin-sass-palette/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"@vuepress/bundler-webpack": "2.0.0-rc.18"
},
"peerDependencies": {
"sass": "^1.79.2",
"sass-embedded": "^1.79.2",
"sass-loader": "^16.0.1",
"sass": "^1.80.3",
"sass-embedded": "^1.80.3",
"sass-loader": "^16.0.2",
"vuepress": "2.0.0-rc.18"
},
"peerDependenciesMeta": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addViteConfig } from '@vuepress/helper'
import { addViteConfig, chainWebpack } from '@vuepress/helper'
import { watch } from 'chokidar'
import type { PluginFunction } from 'vuepress/core'
import { getDirname, path } from 'vuepress/utils'
Expand Down Expand Up @@ -68,19 +68,39 @@ export const sassPalettePlugin =
},

extendsBundlerOptions: (bundlerOptions: unknown): void => {
// switch to modern api for vite
// switch to modern api and silent import deprecation for vite
addViteConfig(bundlerOptions, app, {
css: {
preprocessorOptions: {
sass: {
api: 'modern',
silenceDeprecations: ['import'],
},
scss: {
api: 'modern',
silenceDeprecations: ['import'],
},
},
},
})
// silent import deprecation for webpack
chainWebpack(bundlerOptions, app, (webpackOptions) => {
webpackOptions.module
.rule('scss')
.use('sass-loader')
.tap((loaderOptions) => ({
...loaderOptions,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
sassOptions: {
...loaderOptions.sassOptions,
silenceDeprecations: [
'import',
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
...(loaderOptions.sassOptions?.silenceDeprecations ?? []),
],
},
}))
})
injectScssConfigModule(bundlerOptions, app, id)
},

Expand Down
2 changes: 1 addition & 1 deletion plugins/development/plugin-theme-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"copy": "cpx \"src/**/*.d.ts\" lib"
},
"dependencies": {
"@vue/devtools-api": "^7.4.6",
"@vue/devtools-api": "^7.5.2",
"vue": "^3.5.12"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@

background: var(--back-to-top-c-icon);

-webkit-mask-image: var(--back-to-top-icon);
mask-image: var(--back-to-top-icon);
-webkit-mask-position: 50%;
mask-position: 50%;
-webkit-mask-size: cover;
mask-size: cover;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@

font-size: 1.25rem;

-webkit-mask-image: var(--code-copy-icon);
mask-image: var(--code-copy-icon);
-webkit-mask-position: 50%;
mask-position: 50%;
-webkit-mask-size: 1em;
mask-size: 1em;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
}

Expand All @@ -58,7 +54,6 @@

&.copied {
&::before {
-webkit-mask-image: var(--code-copied-icon);
mask-image: var(--code-copied-icon);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
z-index: calc(var(--medium-zoom-z-index) + 1);
}

/* stylelint-disable-next-line selector-class-pattern */
.medium-zoom--opened .medium-zoom-overlay {
opacity: var(--medium-zoom-opacity);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-coldark-cold.css
*/

/* stylelint-disable selector-max-class */

$code-text-color: #111b27;
$code-bg-color: #e3eaf2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-coldark-dark.css
*/

/* stylelint-disable selector-max-class */

$code-text-color: #e3eaf2;
$code-bg-color: #111b27;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-one-dark.css
*/

/* stylelint-disable selector-max-class */

$code-text-color: #abb2bf;
$code-bg-color: #282c34;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-one-light.css
*/

/* stylelint-disable selector-max-class */

$code-text-color: #383a42;
$code-bg-color: #ecf4fa;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-shades-of-purple.css
*/

/* stylelint-disable selector-max-class */

$code-text-color: #9efeff;
$code-bg-color: #1e1e3f;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-vsc-dark-plus.css
*/

/* stylelint-disable selector-max-class */

$code-text-color: #d4d4d4;
$code-bg-color: #1e1e1e;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Copied from https://github.com/PrismJS/prism-themes/blob/master/themes/prism-duotone-forest.css
*/

/* stylelint-disable selector-max-class */

$code-text-color: #76d9e6;
$code-bg-color: #2a2a2a;

Expand Down
Loading

0 comments on commit b27c7ac

Please sign in to comment.