Skip to content

Commit 1227d20

Browse files
committed
Merge branch 'main' into markdown-links
2 parents 366c223 + c443a95 commit 1227d20

File tree

21 files changed

+5952
-4629
lines changed

21 files changed

+5952
-4629
lines changed

e2e/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
"@vuepress-e2e/conditional-exports": "file:./modules/conditional-exports",
2020
"@vuepress/bundler-vite": "workspace:*",
2121
"@vuepress/bundler-webpack": "workspace:*",
22-
"sass": "^1.74.1",
23-
"sass-loader": "^14.1.1",
24-
"vue": "^3.4.21",
22+
"sass": "^1.75.0",
23+
"sass-loader": "^14.2.1",
24+
"vue": "^3.4.23",
2525
"vuepress": "workspace:*"
2626
},
2727
"devDependencies": {
28-
"@playwright/test": "^1.43.0",
28+
"@playwright/test": "^1.43.1",
2929
"anywhere": "^1.6.0",
3030
"cross-env": "^7.0.3"
3131
}

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
},
3131
"prettier": "prettier-config-vuepress",
3232
"devDependencies": {
33-
"@commitlint/cli": "^19.2.1",
34-
"@commitlint/config-conventional": "^19.1.0",
33+
"@commitlint/cli": "^19.2.2",
34+
"@commitlint/config-conventional": "^19.2.2",
3535
"@commitlint/types": "^19.0.3",
36-
"@types/node": "^20.12.5",
36+
"@types/node": "^20.12.7",
3737
"@types/webpack-env": "^1.18.4",
38-
"@vitest/coverage-istanbul": "^1.4.0",
38+
"@vitest/coverage-istanbul": "^1.5.0",
3939
"bumpp": "^9.4.0",
4040
"conventional-changelog-cli": "^4.1.0",
4141
"eslint": "^8.57.0",
@@ -49,11 +49,11 @@
4949
"sort-package-json": "^2.10.0",
5050
"tsconfig-vuepress": "^4.5.0",
5151
"tsup": "^8.0.2",
52-
"typescript": "^5.4.4",
53-
"vite": "~5.2.8",
54-
"vitest": "^1.4.0"
52+
"typescript": "^5.4.5",
53+
"vite": "~5.2.10",
54+
"vitest": "^1.5.0"
5555
},
56-
"packageManager": "pnpm@8.15.6",
56+
"packageManager": "pnpm@9.0.4",
5757
"engines": {
5858
"node": ">=18.16.0"
5959
}

packages/bundler-vite/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
"connect-history-api-fallback": "^2.0.0",
4343
"postcss": "^8.4.38",
4444
"postcss-load-config": "^5.0.3",
45-
"rollup": "^4.14.1",
46-
"vite": "~5.2.8",
47-
"vue": "^3.4.21",
48-
"vue-router": "^4.3.0"
45+
"rollup": "^4.16.0",
46+
"vite": "~5.2.10",
47+
"vue": "^3.4.23",
48+
"vue-router": "^4.3.2"
4949
},
5050
"publishConfig": {
5151
"access": "public"

packages/bundler-vite/src/plugins/vuepressMainPlugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ import 'vuepress/client-app'
8282
host: app.options.host,
8383
port: app.options.port,
8484
open: app.options.open,
85+
// ref: https://github.com/vitejs/vite/issues/15784#issuecomment-1923683823
86+
fs: { cachedChecks: false },
8587
},
8688
build: {
8789
ssr: isServer,

packages/bundler-webpack/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@
4545
"autoprefixer": "^10.4.19",
4646
"chokidar": "^3.6.0",
4747
"copy-webpack-plugin": "^12.0.2",
48-
"css-loader": "^7.0.0",
48+
"css-loader": "^7.1.1",
4949
"esbuild-loader": "~4.1.0",
5050
"express": "^4.19.2",
5151
"html-webpack-plugin": "^5.6.0",
52-
"mini-css-extract-plugin": "^2.8.1",
52+
"mini-css-extract-plugin": "^2.9.0",
5353
"postcss": "^8.4.38",
5454
"postcss-csso": "^6.0.1",
5555
"postcss-loader": "^8.1.1",
56-
"style-loader": "^3.3.4",
57-
"vue": "^3.4.21",
56+
"style-loader": "^4.0.0",
57+
"vue": "^3.4.23",
5858
"vue-loader": "^17.4.2",
59-
"vue-router": "^4.3.0",
59+
"vue-router": "^4.3.2",
6060
"webpack": "^5.91.0",
6161
"webpack-chain": "^6.5.1",
6262
"webpack-dev-server": "^5.0.4",

packages/client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
"dependencies": {
4040
"@vue/devtools-api": "^6.6.1",
4141
"@vuepress/shared": "workspace:*",
42-
"vue": "^3.4.21",
43-
"vue-router": "^4.3.0"
42+
"vue": "^3.4.23",
43+
"vue-router": "^4.3.2"
4444
},
4545
"publishConfig": {
4646
"access": "public"

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@vuepress/markdown": "workspace:*",
3636
"@vuepress/shared": "workspace:*",
3737
"@vuepress/utils": "workspace:*",
38-
"vue": "^3.4.21"
38+
"vue": "^3.4.23"
3939
},
4040
"publishConfig": {
4141
"access": "public"

packages/core/src/page/resolvePageChunkInfo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { path, sanitizeFileName } from '@vuepress/utils'
1+
import { path, transformPathToFileName } from '@vuepress/utils'
22
import type { App } from '../types/index.js'
33

44
/**
@@ -17,7 +17,7 @@ export const resolvePageChunkInfo = ({
1717
} => {
1818
const chunkFilePathRelative = path.join('pages', `${htmlFilePathRelative}.js`)
1919
const chunkFilePath = app.dir.temp(chunkFilePathRelative)
20-
const chunkName = sanitizeFileName(path.basename(htmlFilePathRelative))
20+
const chunkName = transformPathToFileName(htmlFilePathRelative)
2121

2222
return {
2323
chunkFilePath,

packages/core/src/page/resolvePagePermalink.ts

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,23 @@ export const resolvePagePermalink = ({
2020
pathInferred: string | null
2121
pathLocale: string
2222
}): string | null => {
23-
// use permalink in frontmatter directly
23+
// frontmatter.permalink has the highest priority
24+
if (frontmatter.permalink === null) {
25+
return null
26+
}
2427
if (isString(frontmatter.permalink)) {
2528
return frontmatter.permalink
2629
}
2730

28-
// get permalink pattern
29-
const permalinkPattern = getPermalinkPattern({ app, frontmatter })
30-
if (permalinkPattern === null) {
31+
// frontmatter.permalinkPattern has higher priority than app.options.permalinkPattern
32+
if (frontmatter.permalinkPattern === null) {
33+
return null
34+
}
35+
36+
const permalinkPattern =
37+
frontmatter.permalinkPattern || app.options.permalinkPattern
38+
39+
if (!isString(permalinkPattern)) {
3140
return null
3241
}
3342

@@ -45,22 +54,3 @@ export const resolvePagePermalink = ({
4554

4655
return ensureLeadingSlash(link)
4756
}
48-
49-
/**
50-
* Get permalink pattern from frontmatter or app options
51-
*/
52-
const getPermalinkPattern = ({
53-
app,
54-
frontmatter,
55-
}: {
56-
app: App
57-
frontmatter: PageFrontmatter
58-
}): string | null => {
59-
if (frontmatter.permalinkPattern === null) {
60-
return null
61-
}
62-
if (isString(frontmatter.permalinkPattern)) {
63-
return frontmatter.permalinkPattern
64-
}
65-
return app.options.permalinkPattern
66-
}

packages/core/tests/page/resolvePagePermalink.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ describe('core > page > resolvePagePermalink', () => {
3636
expect(resolved).toBe('/frontmatter')
3737
})
3838

39+
it('should return null', () => {
40+
const resolved = resolvePagePermalink({
41+
app: appWithPermalinkPattern,
42+
frontmatter: {
43+
permalink: null,
44+
},
45+
slug: '',
46+
date: '',
47+
pathInferred: '/inferred',
48+
pathLocale: '',
49+
})
50+
51+
expect(resolved).toBe(null)
52+
})
53+
3954
it('should use permalinkPattern in frontmatter', () => {
4055
const resolved = resolvePagePermalink({
4156
app,

0 commit comments

Comments
 (0)