Skip to content

Commit b302131

Browse files
authoredJul 2, 2024··
chore: update infrastructure for UI (#39)
更新 UI 部分的基础设施。 1. 更新所有的依赖为最新版本。 2. 添加 `@halo-dev/api-client` 和 `axios` 依赖。 3. pnpm 要求提升至 9。 4. 更新 Node 的 Gradle 插件。 ```release-note None ```
1 parent dad7849 commit b302131

13 files changed

+2793
-3378
lines changed
 

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Halo 2.0 插件开发快速开始模板。
99
所需环境:
1010

1111
1. Java 17
12-
2. Node 18
13-
3. pnpm 8
12+
2. Node 20
13+
3. pnpm 9
1414
4. Docker (可选)
1515

1616
克隆项目:

‎build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id "com.github.node-gradle.node" version "5.0.0"
3+
id "com.github.node-gradle.node" version "7.0.2"
44
id "io.freefair.lombok" version "8.0.1"
55
id "run.halo.plugin.devtools" version "0.0.9"
66
}
@@ -52,5 +52,5 @@ build {
5252
}
5353

5454
halo {
55-
version = '2.11'
55+
version = '2.17'
5656
}

‎ui/.eslintrc.cjs

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ module.exports = {
99
"@vue/eslint-config-typescript/recommended",
1010
"@vue/eslint-config-prettier",
1111
],
12+
parserOptions: {
13+
ecmaVersion: "latest",
14+
},
1215
env: {
1316
"vue/setup-compiler-macros": true,
1417
},

‎ui/env.d.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
/// <reference types="vite/client" />
2-
3-
declare module "*.vue" {
4-
import Vue from "vue";
5-
export default Vue;
6-
}
2+
/// <reference types="unplugin-icons/types/vue" />

‎ui/package.json

+34-31
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,44 @@
11
{
22
"scripts": {
33
"dev": "vite build --watch --mode=development",
4-
"build": "vite build",
5-
"preview": "vite preview --port 4173",
6-
"test:unit": "vitest --environment jsdom",
7-
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
8-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
4+
"build": "run-p type-check \"build-only {@}\" --",
5+
"build-only": "vite build",
6+
"test:unit": "vitest",
7+
"type-check": "vue-tsc --build --force",
8+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
9+
"prettier": "prettier --write src/"
910
},
1011
"dependencies": {
11-
"@halo-dev/components": "^2.12.0",
12-
"@halo-dev/console-shared": "^2.12.0",
13-
"canvas-confetti": "^1.9.2",
14-
"vue": "^3.3.12"
12+
"@halo-dev/api-client": "^2.17.0",
13+
"@halo-dev/components": "^2.17.0",
14+
"@halo-dev/console-shared": "^2.17.0",
15+
"axios": "^1.7.2",
16+
"canvas-confetti": "^1.9.3",
17+
"vue": "^3.4.31"
1518
},
1619
"devDependencies": {
17-
"@halo-dev/ui-plugin-bundler-kit": "^2.12.0",
18-
"@iconify/json": "^2.2.159",
19-
"@rushstack/eslint-patch": "^1.6.1",
20+
"@halo-dev/ui-plugin-bundler-kit": "^2.17.0",
21+
"@iconify/json": "^2.2.224",
22+
"@rushstack/eslint-patch": "^1.10.3",
23+
"@tsconfig/node20": "^20.1.4",
2024
"@types/canvas-confetti": "^1.6.4",
21-
"@types/jsdom": "^20.0.1",
22-
"@types/node": "^16.18.68",
23-
"@vitejs/plugin-vue": "^3.2.0",
24-
"@vitejs/plugin-vue-jsx": "^2.1.1",
25-
"@vue/eslint-config-prettier": "^7.1.0",
26-
"@vue/eslint-config-typescript": "^11.0.3",
27-
"@vue/test-utils": "^2.4.3",
28-
"@vue/tsconfig": "^0.1.3",
29-
"eslint": "^8.56.0",
30-
"eslint-plugin-vue": "^9.19.2",
31-
"jsdom": "^19.0.0",
32-
"npm-run-all": "^4.1.5",
33-
"prettier": "^2.8.8",
34-
"sass": "^1.69.5",
35-
"typescript": "~4.7.4",
36-
"unplugin-icons": "^0.15.3",
37-
"vite": "^4.5.1",
38-
"vitest": "^0.24.5",
39-
"vue-tsc": "^1.8.25"
25+
"@types/jsdom": "^21.1.7",
26+
"@types/node": "^20.14.9",
27+
"@vitejs/plugin-vue": "^5.0.5",
28+
"@vue/eslint-config-prettier": "^9.0.0",
29+
"@vue/eslint-config-typescript": "^13.0.0",
30+
"@vue/test-utils": "^2.4.6",
31+
"@vue/tsconfig": "^0.5.1",
32+
"eslint": "^8.57.0",
33+
"eslint-plugin-vue": "^9.26.0",
34+
"jsdom": "^24.1.0",
35+
"npm-run-all2": "^6.2.0",
36+
"prettier": "^3.3.2",
37+
"sass": "^1.77.6",
38+
"typescript": "~5.5.3",
39+
"unplugin-icons": "^0.19.0",
40+
"vite": "^5.3.2",
41+
"vitest": "^1.6.0",
42+
"vue-tsc": "^2.0.24"
4043
}
4144
}

‎ui/pnpm-lock.yaml

+2,724-3,316
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎ui/src/views/HomeView.vue

+6-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ onMounted(() => {
3636
</span>
3737
</a>
3838
<a
39-
href="https://docs.halo.run/developer-guide/plugin/structure"
39+
href="https://docs.halo.run/category/%E5%9F%BA%E7%A1%80"
4040
class="docs__box"
4141
target="_blank"
4242
>
@@ -60,7 +60,7 @@ onMounted(() => {
6060
</span>
6161
</a>
6262
<a
63-
href="https://docs.halo.run/developer-guide/plugin/api-reference/extension"
63+
href="https://docs.halo.run/category/api-%E5%8F%82%E8%80%83"
6464
class="docs__box"
6565
target="_blank"
6666
>
@@ -119,7 +119,10 @@ onMounted(() => {
119119
drop-shadow(0 1px 1px rgb(0 0 0 / 0.06));
120120
121121
&:hover {
122-
box-shadow: 0 0 0 0px #fff, 0 0 0 1px rgb(59 130 246 / 0.5), 0 0 #0000;
122+
box-shadow:
123+
0 0 0 0px #fff,
124+
0 0 0 1px rgb(59 130 246 / 0.5),
125+
0 0 #0000;
123126
}
124127
125128
.docs__box-title {

‎ui/tsconfig.app.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
2-
"extends": "@vue/tsconfig/tsconfig.web.json",
2+
"extends": "@vue/tsconfig/tsconfig.dom.json",
33
"include": ["./env.d.ts", "./src/**/*", "./src/**/*.vue"],
44
"exclude": ["./src/**/__tests__/*"],
55
"compilerOptions": {
66
"composite": true,
7+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
78
"baseUrl": ".",
89
"paths": {
910
"@/*": ["./src/*"]

‎ui/tsconfig.config.json

-8
This file was deleted.

‎ui/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"files": [],
33
"references": [
44
{
5-
"path": "./tsconfig.config.json"
5+
"path": "./tsconfig.node.json"
66
},
77
{
88
"path": "./tsconfig.app.json"

‎ui/tsconfig.node.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "@tsconfig/node20/tsconfig.json",
3+
"include": ["vite.config.*", "vitest.config.*"],
4+
"compilerOptions": {
5+
"composite": true,
6+
"noEmit": true,
7+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
8+
9+
"module": "ESNext",
10+
"moduleResolution": "Bundler",
11+
"types": ["node"]
12+
}
13+
}

‎ui/tsconfig.vitest.json

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"exclude": [],
44
"compilerOptions": {
55
"composite": true,
6+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
7+
68
"lib": [],
79
"types": ["node", "jsdom"]
810
}

‎ui/vite.config.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
import { fileURLToPath, URL } from "url";
22

3-
import { defineConfig } from "vite";
3+
import { HaloUIPluginBundlerKit } from "@halo-dev/ui-plugin-bundler-kit";
44
import Vue from "@vitejs/plugin-vue";
5-
import VueJsx from "@vitejs/plugin-vue-jsx";
65
import Icons from "unplugin-icons/vite";
7-
import { HaloUIPluginBundlerKit } from "@halo-dev/ui-plugin-bundler-kit";
6+
import { defineConfig } from "vite";
87

98
export default defineConfig({
10-
plugins: [
11-
Vue(),
12-
VueJsx(),
13-
Icons({ compiler: "vue3" }),
14-
HaloUIPluginBundlerKit(),
15-
],
9+
plugins: [Vue(), Icons({ compiler: "vue3" }), HaloUIPluginBundlerKit()],
1610
resolve: {
1711
alias: {
1812
"@": fileURLToPath(new URL("./src", import.meta.url)),

0 commit comments

Comments
 (0)
Please sign in to comment.