Skip to content

Commit fdc75f6

Browse files
authored
Merge branch 'main' into route-relative
2 parents 90e218a + e6455e0 commit fdc75f6

File tree

20 files changed

+500
-435
lines changed

20 files changed

+500
-435
lines changed
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
const fs = require('fs')
2-
const path = require('path')
1+
import * as fs from 'node:fs'
2+
import * as path from 'node:path'
3+
import type { UserConfig } from '@commitlint/types'
34

4-
const getSubDirectories = (dir) =>
5+
const getSubDirectories = (dir: string): string[] =>
56
fs
67
.readdirSync(dir)
78
.filter((item) => fs.statSync(path.join(dir, item)).isDirectory())
89
const packages = getSubDirectories(path.resolve(__dirname, 'packages'))
910

10-
module.exports = {
11+
export default {
1112
extends: ['@commitlint/config-conventional'],
1213
rules: {
1314
'scope-enum': [2, 'always', packages],
1415
'footer-max-line-length': [0],
1516
},
16-
}
17+
} satisfies UserConfig

e2e/docs/router/navigation.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<button id="home" @click="goHome">Home</button>
2+
<button id="404" @click="go404">404</button>
3+
4+
<script setup lang="ts">
5+
import { useRouter } from 'vuepress/client';
6+
7+
const router = useRouter();
8+
9+
const goHome = () => {
10+
router.push('/?home=true');
11+
}
12+
13+
const go404 = () => {
14+
router.push('/404.html#404');
15+
}
16+
</script>

e2e/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
"@vuepress-e2e/conditional-exports": "file:./modules/conditional-exports",
2222
"@vuepress/bundler-vite": "workspace:*",
2323
"@vuepress/bundler-webpack": "workspace:*",
24-
"sass": "^1.72.0",
24+
"sass": "^1.74.1",
2525
"sass-loader": "^14.1.1",
2626
"vue": "^3.4.21",
2727
"vuepress": "workspace:*"
2828
},
2929
"devDependencies": {
3030
"anywhere": "^1.6.0",
3131
"cross-env": "^7.0.3",
32-
"cypress": "^13.7.1",
32+
"cypress": "^13.7.2",
3333
"process": "^0.11.10",
3434
"start-server-and-test": "^2.0.3"
3535
}

e2e/tests/router/navigation.cy.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
it('should preserve query', () => {
2+
const E2E_BASE = Cypress.env('E2E_BASE')
3+
4+
cy.visit('/router/navigation.html')
5+
6+
cy.get('#home').click()
7+
8+
cy.location('pathname').should('eq', E2E_BASE)
9+
cy.location('search').should('eq', '?home=true')
10+
})
11+
12+
it('should preserve hash', () => {
13+
const E2E_BASE = Cypress.env('E2E_BASE')
14+
15+
cy.visit('/router/navigation.html')
16+
17+
cy.get('#404').click()
18+
19+
cy.location('pathname').should('eq', `${E2E_BASE}404.html`)
20+
cy.location('hash').should('eq', '#404')
21+
})

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"devDependencies": {
3333
"@commitlint/cli": "^19.2.1",
3434
"@commitlint/config-conventional": "^19.1.0",
35-
"@types/node": "^20.11.30",
35+
"@commitlint/types": "^19.0.3",
36+
"@types/node": "^20.12.5",
3637
"@types/webpack-env": "^1.18.4",
3738
"@vitest/coverage-istanbul": "^1.4.0",
3839
"bumpp": "^9.4.0",
@@ -46,14 +47,14 @@
4647
"prettier": "^3.2.5",
4748
"prettier-config-vuepress": "^4.4.0",
4849
"rimraf": "^5.0.5",
49-
"sort-package-json": "^2.8.0",
50+
"sort-package-json": "^2.10.0",
5051
"tsconfig-vuepress": "^4.5.0",
5152
"tsup": "^8.0.2",
52-
"typescript": "^5.4.3",
53-
"vite": "~5.2.2",
53+
"typescript": "^5.4.4",
54+
"vite": "~5.2.8",
5455
"vitest": "^1.4.0"
5556
},
56-
"packageManager": "[email protected].5",
57+
"packageManager": "[email protected].6",
5758
"engines": {
5859
"node": ">=18.16.0"
5960
}

packages/bundler-vite/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
"connect-history-api-fallback": "^2.0.0",
4343
"postcss": "^8.4.38",
4444
"postcss-load-config": "^5.0.3",
45-
"rollup": "^4.13.0",
46-
"vite": "~5.2.2",
45+
"rollup": "^4.14.1",
46+
"vite": "~5.2.8",
4747
"vue": "^3.4.21",
4848
"vue-router": "^4.3.0"
4949
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ const resolveDefine = async ({
209209
// enable options API by default
210210
__VUE_OPTIONS_API__: JSON.stringify(true),
211211
__VUE_PROD_DEVTOOLS__: JSON.stringify(app.env.isDebug),
212-
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: JSON.stringify(false),
212+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: JSON.stringify(app.env.isDebug),
213213
}
214214

215215
// override vite built-in define config in debug mode

packages/bundler-webpack/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
"autoprefixer": "^10.4.19",
4646
"chokidar": "^3.6.0",
4747
"copy-webpack-plugin": "^12.0.2",
48-
"css-loader": "^6.10.0",
48+
"css-loader": "^7.0.0",
4949
"esbuild-loader": "~4.1.0",
50-
"express": "^4.19.1",
50+
"express": "^4.19.2",
5151
"html-webpack-plugin": "^5.6.0",
5252
"mini-css-extract-plugin": "^2.8.1",
5353
"postcss": "^8.4.38",

packages/bundler-webpack/src/config/handlePluginDefine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const handlePluginDefine = async ({
2727
// enable options API by default
2828
__VUE_OPTIONS_API__: JSON.stringify(true),
2929
__VUE_PROD_DEVTOOLS__: JSON.stringify(app.env.isDebug),
30-
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: JSON.stringify(false),
30+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: JSON.stringify(app.env.isDebug),
3131
},
3232
])
3333

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@vuepress/utils": "workspace:*",
4242
"cac": "^6.7.14",
4343
"chokidar": "^3.6.0",
44-
"envinfo": "^7.11.1",
44+
"envinfo": "^7.12.0",
4545
"esbuild": "~0.20.2"
4646
},
4747
"devDependencies": {

0 commit comments

Comments
 (0)