Skip to content

Commit d2238ee

Browse files
authored
feat: switch to vite 5 and bump deps (vuejs#3200)
BREAKING CHANGE: VitePress now runs on Vite 5. Please refer https://vitejs.dev/guide/migration for breaking changes and migration guide if you're relying on some Vite-specific things.
1 parent 2d96200 commit d2238ee

File tree

18 files changed

+634
-926
lines changed

18 files changed

+634
-926
lines changed

.npmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
shell-emulator=true
2-
resolution-mode=highest
2+
auto-install-peers=false

__tests__/e2e/__snapshots__/home.test.ts.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ exports[`render correct content > main content 1`] = `
44
[
55
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
66
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
7-
"Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \\"de Finibus Bonorum et Malorum\\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \\"Lorem ipsum dolor sit amet..\\", comes from a line in section 1.10.32.",
8-
"The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from \\"de Finibus Bonorum et Malorum\\" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.",
7+
"Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.",
8+
"The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.",
99
"It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).",
1010
"There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.",
1111
]

__tests__/e2e/data-loading/data.test.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,34 @@ describe('static data file support in vite 3', () => {
77
expect(await page.textContent('pre#basic')).toMatchInlineSnapshot(`
88
"[
99
{
10-
\\"foo\\": true
10+
"foo": true
1111
},
1212
{
13-
\\"bar\\": true
13+
"bar": true
1414
}
1515
]"
1616
`)
1717
expect(await page.textContent('pre#content')).toMatchInlineSnapshot(`
1818
"[
1919
{
20-
\\"src\\": \\"---\\\\ntitle: bar\\\\n---\\\\n\\\\nHello\\\\n\\\\n---\\\\n\\\\nworld\\\\n\\",
21-
\\"html\\": \\"<p>Hello</p>\\\\n<hr>\\\\n<p>world</p>\\\\n\\",
22-
\\"frontmatter\\": {
23-
\\"title\\": \\"bar\\"
20+
"src": "---\\ntitle: bar\\n---\\n\\nHello\\n\\n---\\n\\nworld\\n",
21+
"html": "<p>Hello</p>\\n<hr>\\n<p>world</p>\\n",
22+
"frontmatter": {
23+
"title": "bar"
2424
},
25-
\\"excerpt\\": \\"<p>Hello</p>\\\\n\\",
26-
\\"url\\": \\"/data-loading/content/bar.html\\",
27-
\\"transformed\\": true
25+
"excerpt": "<p>Hello</p>\\n",
26+
"url": "/data-loading/content/bar.html",
27+
"transformed": true
2828
},
2929
{
30-
\\"src\\": \\"---\\\\ntitle: foo\\\\n---\\\\n\\\\nHello\\\\n\\\\n---\\\\n\\\\nworld\\\\n\\",
31-
\\"html\\": \\"<p>Hello</p>\\\\n<hr>\\\\n<p>world</p>\\\\n\\",
32-
\\"frontmatter\\": {
33-
\\"title\\": \\"foo\\"
30+
"src": "---\\ntitle: foo\\n---\\n\\nHello\\n\\n---\\n\\nworld\\n",
31+
"html": "<p>Hello</p>\\n<hr>\\n<p>world</p>\\n",
32+
"frontmatter": {
33+
"title": "foo"
3434
},
35-
\\"excerpt\\": \\"<p>Hello</p>\\\\n\\",
36-
\\"url\\": \\"/data-loading/content/foo.html\\",
37-
\\"transformed\\": true
35+
"excerpt": "<p>Hello</p>\\n",
36+
"url": "/data-loading/content/foo.html",
37+
"transformed": true
3838
}
3939
]"
4040
`)

__tests__/init/init.test.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import fs from 'fs-extra'
22
import getPort from 'get-port'
3+
import { nanoid } from 'nanoid'
4+
import path from 'path'
35
import { chromium } from 'playwright-chromium'
46
import { fileURLToPath, URL } from 'url'
57
import { createServer, scaffold, ScaffoldThemeType } from 'vitepress'
68

7-
const root = fileURLToPath(new URL('./.temp', import.meta.url))
9+
const tempDir = fileURLToPath(new URL('./.temp', import.meta.url))
10+
const getTempRoot = () => path.join(tempDir, nanoid())
811

912
const browser = await chromium.launch({
1013
headless: !process.env.DEBUG,
@@ -30,9 +33,11 @@ const variations = themes.flatMap((theme) =>
3033
afterAll(async () => {
3134
await page.close()
3235
await browser.close()
36+
await fs.remove(tempDir)
3337
})
3438

3539
test.each(variations)('init %s', async (_, { theme, useTs }) => {
40+
const root = getTempRoot()
3641
await fs.remove(root)
3742
scaffold({ root, theme, useTs, injectNpmScripts: false })
3843

@@ -62,7 +67,6 @@ test.each(variations)('init %s', async (_, { theme, useTs }) => {
6267

6368
// teardown
6469
} finally {
65-
await fs.remove(root)
6670
await server.close()
6771
}
6872
})

__tests__/unit/node/markdown/plugins/snippet.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('node/markdown/plugins/snippet', () => {
5050
)
5151
).toMatchInlineSnapshot(`
5252
"fn main() {
53-
println!(\\"Hello\\");
53+
println!("Hello");
5454
}"
5555
`)
5656
})

package.json

+44-37
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0-rc.25",
44
"description": "Vite & Vue powered static site generator",
55
"type": "module",
6-
"packageManager": "pnpm@8.9.2",
6+
"packageManager": "pnpm@8.10.5",
77
"main": "dist/node/index.js",
88
"types": "types/index.d.ts",
99
"exports": {
@@ -92,17 +92,17 @@
9292
"dependencies": {
9393
"@docsearch/css": "^3.5.2",
9494
"@docsearch/js": "^3.5.2",
95-
"@types/markdown-it": "^13.0.4",
96-
"@vitejs/plugin-vue": "4.3.1",
95+
"@types/markdown-it": "^13.0.6",
96+
"@vitejs/plugin-vue": "^4.5.0",
9797
"@vue/devtools-api": "^6.5.1",
98-
"@vueuse/core": "^10.5.0",
99-
"@vueuse/integrations": "^10.5.0",
98+
"@vueuse/core": "^10.6.1",
99+
"@vueuse/integrations": "^10.6.1",
100100
"focus-trap": "^7.5.4",
101101
"mark.js": "8.11.1",
102-
"minisearch": "^6.1.0",
102+
"minisearch": "^6.2.0",
103103
"shiki": "^0.14.5",
104-
"vite": "^4.5.0",
105-
"vue": "^3.3.6"
104+
"vite": "^5.0.0",
105+
"vue": "^3.3.8"
106106
},
107107
"peerDependencies": {
108108
"markdown-it-mathjax3": "^4.3.2",
@@ -129,23 +129,23 @@
129129
"@rollup/plugin-commonjs": "^25.0.7",
130130
"@rollup/plugin-json": "^6.0.1",
131131
"@rollup/plugin-node-resolve": "^15.2.3",
132-
"@rollup/plugin-replace": "^5.0.4",
133-
"@types/compression": "^1.7.4",
134-
"@types/cross-spawn": "^6.0.4",
135-
"@types/debug": "^4.1.10",
136-
"@types/escape-html": "^1.0.3",
137-
"@types/fs-extra": "^11.0.3",
138-
"@types/lodash.template": "^4.5.2",
139-
"@types/mark.js": "^8.11.10",
140-
"@types/markdown-it-attrs": "^4.1.2",
141-
"@types/markdown-it-container": "^2.0.8",
142-
"@types/markdown-it-emoji": "^2.0.3",
143-
"@types/micromatch": "^4.0.4",
144-
"@types/minimist": "^1.2.4",
145-
"@types/node": "^20.8.7",
146-
"@types/postcss-prefix-selector": "^1.16.2",
147-
"@types/prompts": "^2.4.7",
148-
"@vue/shared": "^3.3.6",
132+
"@rollup/plugin-replace": "^5.0.5",
133+
"@types/compression": "^1.7.5",
134+
"@types/cross-spawn": "^6.0.5",
135+
"@types/debug": "^4.1.12",
136+
"@types/escape-html": "^1.0.4",
137+
"@types/fs-extra": "^11.0.4",
138+
"@types/lodash.template": "^4.5.3",
139+
"@types/mark.js": "^8.11.11",
140+
"@types/markdown-it-attrs": "^4.1.3",
141+
"@types/markdown-it-container": "^2.0.9",
142+
"@types/markdown-it-emoji": "^2.0.4",
143+
"@types/micromatch": "^4.0.5",
144+
"@types/minimist": "^1.2.5",
145+
"@types/node": "^20.9.0",
146+
"@types/postcss-prefix-selector": "^1.16.3",
147+
"@types/prompts": "^2.4.8",
148+
"@vue/shared": "^3.3.8",
149149
"chokidar": "^3.5.3",
150150
"compression": "^1.7.4",
151151
"conventional-changelog-cli": "^4.1.0",
@@ -154,13 +154,13 @@
154154
"esbuild": "^0.19.5",
155155
"escape-html": "^1.0.3",
156156
"execa": "^8.0.1",
157-
"fast-glob": "^3.3.1",
157+
"fast-glob": "^3.3.2",
158158
"fs-extra": "^11.1.1",
159159
"get-port": "^7.0.0",
160160
"gray-matter": "^4.0.3",
161-
"lint-staged": "^15.0.2",
161+
"lint-staged": "^15.1.0",
162162
"lodash.template": "^4.5.0",
163-
"lru-cache": "^10.0.1",
163+
"lru-cache": "^10.0.2",
164164
"markdown-it": "^13.0.2",
165165
"markdown-it-anchor": "^8.6.7",
166166
"markdown-it-attrs": "^4.1.6",
@@ -169,20 +169,20 @@
169169
"markdown-it-mathjax3": "^4.3.2",
170170
"micromatch": "^4.0.5",
171171
"minimist": "^1.2.8",
172-
"nanoid": "^5.0.2",
172+
"nanoid": "^5.0.3",
173173
"npm-run-all": "^4.1.5",
174174
"ora": "^7.0.1",
175175
"path-to-regexp": "^6.2.1",
176176
"picocolors": "^1.0.0",
177-
"pkg-dir": "^7.0.0",
177+
"pkg-dir": "^8.0.0",
178178
"playwright-chromium": "^1.39.0",
179-
"polka": "1.0.0-next.22",
179+
"polka": "1.0.0-next.23",
180180
"postcss-prefix-selector": "^1.16.0",
181-
"prettier": "^3.0.3",
181+
"prettier": "^3.1.0",
182182
"prompts": "^2.4.2",
183-
"punycode": "^2.3.0",
183+
"punycode": "^2.3.1",
184184
"rimraf": "^5.0.5",
185-
"rollup": "^4.1.4",
185+
"rollup": "^4.4.1",
186186
"rollup-plugin-dts": "^6.1.0",
187187
"rollup-plugin-esbuild": "^6.1.0",
188188
"semver": "^7.5.4",
@@ -192,9 +192,9 @@
192192
"sitemap": "^7.1.1",
193193
"supports-color": "^9.4.0",
194194
"typescript": "^5.2.2",
195-
"vitest": "^0.34.6",
196-
"vue-tsc": "^1.8.19",
197-
"wait-on": "^7.0.1"
195+
"vitest": "^1.0.0-beta.4",
196+
"vue-tsc": "^1.8.22",
197+
"wait-on": "^7.2.0"
198198
},
199199
"simple-git-hooks": {
200200
"pre-commit": "pnpm lint-staged"
@@ -207,6 +207,13 @@
207207
"pnpm": {
208208
"overrides": {
209209
"ora>string-width": "^5"
210+
},
211+
"peerDependencyRules": {
212+
"ignoreMissing": [
213+
"@algolia/client-search",
214+
"search-insights",
215+
"postcss"
216+
]
210217
}
211218
}
212219
}

0 commit comments

Comments
 (0)