Skip to content

Commit 95643c0

Browse files
authored
chore: update vitepress to v1.0.0-rc.14 and use search option (#609)
1 parent 6610b18 commit 95643c0

File tree

7 files changed

+1807
-1747
lines changed

7 files changed

+1807
-1747
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/dist
44
/docs/.vitepress/dist
55
/docs/.vitepress/build-system/shim/eslint.mjs
6+
/docs/.vitepress/cache
67
/node_modules
78
/assets
89
!/docs/.vitepress

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,4 @@ dist
105105

106106
## Repo
107107
docs/.vitepress/build-system/shim/eslint.mjs
108+
docs/.vitepress/cache

docs/.vitepress/config.ts docs/.vitepress/config.mts

+13-12
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@ import { defineConfig } from "vitepress"
33
import { BUNDLED_LANGUAGES } from "shiki"
44
import path from "path"
55
import { fileURLToPath } from "url"
6-
import { rules } from "../../lib/utils/rules"
7-
import type { RuleModule } from "../../lib/types"
6+
import { rules } from "../../lib/utils/rules.js"
7+
import type { RuleModule } from "../../lib/types.js"
88

99
// Pre-build cjs packages that cannot be bundled well.
1010
import "./build-system/build"
1111

12-
const dirname = path.dirname(
13-
fileURLToPath(
14-
// @ts-expect-error -- Cannot change `module` option
15-
import.meta.url,
16-
),
17-
)
12+
const dirname = path.dirname(fileURLToPath(import.meta.url))
1813

1914
// Include `json5` as alias for jsonc
2015
const jsonc = BUNDLED_LANGUAGES.find((lang) => lang.id === "jsonc")
@@ -67,6 +62,12 @@ export default defineConfig({
6762

6863
lastUpdated: true,
6964
themeConfig: {
65+
search: {
66+
provider: "local",
67+
options: {
68+
detailedView: true,
69+
},
70+
},
7071
editLink: {
7172
pattern:
7273
"https://github.com/ota-meshi/eslint-plugin-regexp/edit/master/docs/:path",
@@ -92,17 +93,17 @@ export default defineConfig({
9293
},
9394
{
9495
text: "Possible Errors",
95-
collapsible: false,
96+
collapsed: false,
9697
items: categories["Possible Errors"].map(ruleToSidebarItem),
9798
},
9899
{
99100
text: "Best Practices",
100-
collapsible: false,
101+
collapsed: false,
101102
items: categories["Best Practices"].map(ruleToSidebarItem),
102103
},
103104
{
104105
text: "Stylistic Issues",
105-
collapsible: false,
106+
collapsed: false,
106107
items: categories["Stylistic Issues"].map(
107108
ruleToSidebarItem,
108109
),
@@ -111,7 +112,7 @@ export default defineConfig({
111112
? [
112113
{
113114
text: "Deprecated",
114-
collapsible: false,
115+
collapsed: false,
115116
items: categories.deprecated.map(
116117
ruleToSidebarItem,
117118
),

lib/utils/ts-utils/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ export function getTypeScript(): TypeScript | undefined {
5454
// For browser
5555
return undefined
5656
}
57+
if (
58+
typeof e.message === "string" &&
59+
e.message.includes("Dynamic require") &&
60+
e.message.includes("is not supported")
61+
) {
62+
// For vite config
63+
return undefined
64+
}
5765

5866
throw e
5967
}

package-lock.json

+1,781-1,733
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"stylelint-config-standard-vue": "^1.0.0",
9999
"ts-node": "^10.2.1",
100100
"typescript": "~5.2.0",
101-
"vitepress": "^1.0.0-alpha.29",
101+
"vitepress": "^1.0.0-rc.14",
102102
"vue-eslint-parser": "^9.0.0"
103103
},
104104
"dependencies": {

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"tests/**/*",
2929
"tools/**/*",
3030
"typings/**/*",
31-
"docs/.vitepress/**/*.ts"
31+
"docs/.vitepress/**/*.ts",
32+
"docs/.vitepress/**/*.mts"
3233
]
3334
}

0 commit comments

Comments
 (0)