Skip to content

Commit d2fb15b

Browse files
committed
chore: upgrade valaxy deps
1 parent bdb78d6 commit d2fb15b

25 files changed

+3111
-2915
lines changed

.eslintrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,37 @@
1111
"i18n-ally.keystyle": "nested",
1212
"i18n-ally.localesPaths": ["./locales"],
1313
"i18n-ally.sortKeys": true,
14-
"prettier.enable": true,
15-
"editor.codeActionsOnSave": {
16-
"source.fixAll.eslint": true
17-
},
1814
"files.associations": {
1915
"*.css": "postcss"
2016
},
21-
"editor.formatOnSave": false,
2217
"[scss]": {
2318
"editor.formatOnSave": true
2419
},
25-
"svg.preview.background": "editor"
20+
"svg.preview.background": "editor",
21+
22+
// Enable the ESlint flat config support
23+
"eslint.experimental.useFlatConfig": true,
24+
// Disable the default formatter, use eslint instead
25+
"prettier.enable": false,
26+
"editor.formatOnSave": false,
27+
// Auto fix
28+
"editor.codeActionsOnSave": {
29+
"source.fixAll.eslint": "explicit",
30+
"source.organizeImports": "never"
31+
},
32+
33+
// Enable eslint for all supported languages
34+
"eslint.validate": [
35+
"javascript",
36+
"javascriptreact",
37+
"typescript",
38+
"typescriptreact",
39+
"vue",
40+
"html",
41+
"markdown",
42+
"json",
43+
"jsonc",
44+
"yaml",
45+
"toml"
46+
]
2647
}

demo/netlify.toml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
[build.environment]
2-
# bypass npm auto install
3-
NPM_FLAGS = "--version"
4-
NODE_VERSION = "16"
5-
61
[build]
7-
publish = "dist"
8-
command = "npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build"
2+
publish = "dist"
3+
command = "npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build"
4+
5+
[build.environment]
6+
# bypass npm auto install
7+
NPM_FLAGS = "--version"
8+
NODE_VERSION = "16"
99

1010
[[redirects]]
11-
from = "/*"
12-
to = "/index.html"
13-
status = 200
11+
from = "/*"
12+
to = "/index.html"
13+
status = 200
1414

1515
[[headers]]
16-
for = "/manifest.webmanifest"
17-
[headers.values]
18-
Content-Type = "application/manifest+json"
16+
for = "/manifest.webmanifest"
17+
18+
[headers.values]
19+
Content-Type = "application/manifest+json"

demo/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"type": "module",
23
"private": true,
34
"scripts": {
45
"build": "npm run build:ssg && npm run rss",
@@ -9,11 +10,10 @@
910
"serve": "vite preview"
1011
},
1112
"dependencies": {
12-
"valaxy": "^0.14.6",
13+
"valaxy": "^0.17.2",
1314
"valaxy-theme-gitlink": "link:../valaxy-theme-yun"
1415
},
1516
"devDependencies": {
16-
"nodemon": "^2.0.20",
17-
"vite-plugin-inspect": "^0.7.15"
17+
"nodemon": "^3.0.3"
1818
}
1919
}

demo/pages/posts/i18n.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You can click this button to toggle locales.
3030
> 此外还可使用 [crowdin](https://crowdin.com/) 平台辅助用户进行多语言翻译。
3131
3232
但对于博客来说,这显然都很麻烦。
33-
当你需要 i18n 时,你不得不同时维护多个目录下的文章。
33+
当你需要 i18n 时,你不得不同时维护多个目录下的文章。
3434
当文章间存在相同的示例时,你还需要维护相同的内容。非常不优雅。
3535

3636
Valaxy 中,
@@ -52,7 +52,7 @@ Common i18n schemes are maintained separately using different paths (e.g. `/zh-C
5252
> In addition, the [crowdin](https://crowdin.com/) platform can be used to assist users with multilingual translations.
5353
5454
But for blogs, this is obviously all a hassle.
55-
When you need i18n, you have to maintain articles in multiple directories at the same time.
55+
When you need i18n, you have to maintain articles in multiple directories at the same time.
5656
You also have to maintain the same content when the same examples exist between articles.
5757
Very inelegant.
5858

@@ -70,13 +70,12 @@ The large text sections of the article content section use a different CSS i18n
7070
配置 Vite Vue-i18n 插件 [@intlify/vite-plugin-vue-i18n](https://github.com/intlify/bundle-tools/tree/main/packages/vite-plugin-vue-i18n)
7171
:::
7272

73-
7473
::: en
7574
Config Vite Vue-i18n plugin [@intlify/vite-plugin-vue-i18n](https://github.com/intlify/bundle-tools/tree/main/packages/vite-plugin-vue-i18n)
7675
:::
7776

7877
```ts
79-
import path from 'path'
78+
import path from 'node:path'
8079
import { defineConfig } from 'vite'
8180
import VueI18n from '@intlify/vite-plugin-vue-i18n'
8281

@@ -180,7 +179,8 @@ And Vite's `import.meta.globEager` import must use a static string.
180179
```ts {3}
181180
const messages = Object.fromEntries(
182181
Object.entries(
183-
import.meta.globEager('../../locales/*.y(a)?ml'))
182+
import.meta.globEager('../../locales/*.y(a)?ml')
183+
)
184184
.map(([key, value]) => {
185185
const yaml = key.endsWith('.yaml')
186186
return [key.slice(14, yaml ? -5 : -4), value.default]
@@ -286,7 +286,7 @@ app.use(i18n)
286286
::: zh-CN
287287
文章部分拥有大段的文本,而 `vue-i18n` 的场景则在于一些独立的字段翻译。
288288

289-
而传统的分文件独立管理的方式,对于博客来说其实并不方便。
289+
而传统的分文件独立管理的方式,对于博客来说其实并不方便。
290290
大多数情况,你并不会想专门建立一个文件夹来管理它。
291291

292292
因此我尝试使用纯 CSS 解决该问题。
@@ -295,7 +295,7 @@ app.use(i18n)
295295
::: en
296296
While the article section has large sections of text, the scenario of `vue-i18n` lies in some separate field translations.
297297

298-
And the traditional way of managing them independently in separate files is not really convenient for blogs.
298+
And the traditional way of managing them independently in separate files is not really convenient for blogs.
299299
In most cases, you don't want to create a dedicated folder to manage it.
300300

301301
So I tried to solve the problem using pure CSS.
@@ -304,7 +304,7 @@ So I tried to solve the problem using pure CSS.
304304
<div lang="zh-CN">
305305

306306
::: tip 思路
307-
即借助 CSS 规则,根据对应语言,显示对应区块内容。
307+
即借助 CSS 规则,根据对应语言,显示对应区块内容。
308308
大体方案:通过 [markdown-it-container](https://github.com/markdown-it/markdown-it-container) 设置 fence 预编译 Markdown,
309309
为需要进行 i18n 的段落包裹新的 `<div lang="zh-CN"></div>`,并使用 CSS 默认隐藏它们。
310310
当页面初始化或切换语言时,为 html 添加对应语言类,编写对应 CSS 以在该类下显示对应语言的区块。
@@ -315,7 +315,7 @@ So I tried to solve the problem using pure CSS.
315315
<div lang="en">
316316

317317
::: tip IDEA
318-
That is, with the help of CSS rules, the content of the corresponding block is displayed according to the corresponding language.
318+
That is, with the help of CSS rules, the content of the corresponding block is displayed according to the corresponding language.
319319
The general solution: set fence to pre-compile Markdown via [markdown-it-container](https://github.com/markdown-it/markdown-it-container).
320320
Wrap new `<div lang="zh-CN"></div>`s for the paragraphs that need to be i18n and hide them by default with CSS.
321321
When the page initializes or switches languages, add the corresponding language class to html and write the corresponding CSS to display the corresponding language block under that class.
@@ -426,7 +426,7 @@ To be able to handle i18n with CSS, we use markdown-it-container's fence to wrap
426426
:::
427427

428428
```ts
429-
export const containerPlugin = (md: MarkdownIt) => {
429+
export function containerPlugin(md: MarkdownIt) {
430430
// ...
431431
const languages = ['zh-CN', 'en']
432432

@@ -540,7 +540,7 @@ When switching languages, the following can be done.
540540
:::
541541
542542
```ts
543-
const toggleLocales = (lang: val) => {
543+
function toggleLocales(lang: val) {
544544
// ...
545545
// save locale
546546
localStorage.setItem('valaxy-locale', lang)

demo/tsconfig.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"compilerOptions": {
3-
"baseUrl": ".",
4-
"module": "ESNext",
53
"target": "ESNext",
6-
"lib": ["DOM", "ESNext"],
7-
"strict": true,
8-
"esModuleInterop": true,
94
"jsx": "preserve",
10-
"skipLibCheck": true,
5+
"lib": ["DOM", "ESNext"],
6+
"baseUrl": ".",
7+
"module": "ESNext",
118
"moduleResolution": "node",
129
"resolveJsonModule": true,
13-
"noUnusedLocals": true,
10+
"strict": true,
1411
"strictNullChecks": true,
15-
"forceConsistentCasingInFileNames": true
12+
"noUnusedLocals": true,
13+
"esModuleInterop": true,
14+
"forceConsistentCasingInFileNames": true,
15+
"skipLibCheck": true
1616
},
1717
"exclude": ["dist", "node_modules"]
1818
}

demo/vite.config.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { defineConfig } from 'vite'
2+
23
// import { VitePWA } from 'vite-plugin-pwa'
3-
// import Inspect from 'vite-plugin-inspect'
44

5-
export default defineConfig({
6-
// https://github.com/antfu/vite-plugin-inspect
7-
// Visit http://localhost:3333/__inspect/ to see the inspector
8-
// plugins: [Inspect()],
9-
})
5+
export default defineConfig({})

eslint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import antfu from '@antfu/eslint-config'
2+
3+
export default antfu()

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2+
"type": "module",
23
"private": true,
3-
"packageManager": "pnpm@7.9.0",
4+
"packageManager": "pnpm@8.14.1",
45
"homepage": "https://valaxy.site",
56
"scripts": {
67
"build": "npm run build:demo",
@@ -13,12 +14,12 @@
1314
"typecheck": "vue-tsc --noEmit --skipLibCheck"
1415
},
1516
"devDependencies": {
16-
"@antfu/eslint-config": "^0.35.1",
17-
"bumpp": "^8.2.1",
18-
"eslint": "^8.33.0",
19-
"typescript": "^4.9.5",
20-
"valaxy": "^0.14.6",
17+
"@antfu/eslint-config": "^2.6.3",
18+
"bumpp": "^9.3.0",
19+
"eslint": "^8.56.0",
20+
"typescript": "^5.3.3",
21+
"valaxy": "^0.17.2",
2122
"valaxy-theme-gitlink": "workspace:*",
22-
"vue-tsc": "^1.0.24"
23+
"vue-tsc": "^1.8.27"
2324
}
2425
}

0 commit comments

Comments
 (0)